1 .. MediaGoblin Documentation
3 Written in 2011, 2012 by MediaGoblin contributors
5 To the extent possible under law, the author(s) have dedicated all
6 copyright and related and neighboring rights to this software to
7 the public domain worldwide. This software is distributed without
10 You should have received a copy of the CC0 Public Domain
11 Dedication along with this software. If not, see
12 <http://creativecommons.org/publicdomain/zero/1.0/>.
18 To use the GNU MediaGoblin API you need to use the dynamic client registration. This has been adapted from the `OpenID specification <https://openid.net/specs/openid-connect-registration-1_0.html>`_, this is the only part of OpenID that is being used to serve the purpose to provide the client registration which is used in OAuth.
20 The endpoint is ``/api/client/register``
25 **required** - This must be either *client_associate* (for new registration) or *client_update*
28 **update only** - This should only be used updating client information, this is the client_id given when you register
31 **update only** - This should only be used updating client information, this is the client_secret given when you register
34 **optional** - This a space seporated list of email addresses to contact of people responsible for the client
37 **required** - This is the type of client you are making, this must be either *web* or *native*
40 **optional** - This is the name of your client
43 **optional** - This is a URI of the logo image for your client
46 **optional** - This is a space seporated list of pre-registered URLs for use at the Authorization Server
52 You will get back a response:
55 This identifies a client
61 This is time that the client credentials expire. If this is 0 the client registration does not expire.
70 To register a client for the first time, this is the minimum you must supply::
73 "type": "client_associate",
74 "application_type": "native"
77 A Response will look like::
80 "client_secret": "hJtfhaQzgKerlLVdaeRAgmbcstSOBLRfgOinMxBCHcb",
82 "client_id": "vwljdhUMhhNbdKizpjZlxv"
89 Using the response we got above we can update the information and add new information we may have opted not to supply::
92 "type": "client_update",
93 "client_id": "vwljdhUMhhNbdKizpjZlxv",
94 "client_secret": "hJtfhaQzgKerlLVdaeRAgmbcstSOBLRfgOinMxBCHcb",
95 "application_type": "web",
96 "application_name": "MyClient!",
97 "logo_uri": "https://myclient.org/images/my_logo.png",
98 "contacts": "myemail@someprovider.com another_developer@provider.net",
101 The response will just return back the client_id and client_secret you sent::
104 "client_id": "vwljdhUMhhNbdKizpjZlxv",
105 "client_secret": "hJtfhaQzgKerlLVdaeRAgmbcstSOBLRfgOinMxBCHcb",
114 There are a number of errors you could get back, This explains what could cause some of them:
116 Could not decode data
117 This is caused when you have an error in the encoding of your data.
120 You should sent a Content-Type header with when you make a request, this should be either application/json or www-form-urlencoded. This is caused when a unknown Content-Type is used.
122 No registration type provided
123 This is when you leave out the ``type``. This should either be client_update or client_associate
125 Unknown application_type.
126 This is when you have provided a ``type`` however this isn't one of the known types.
128 client_id is required to update.
129 When you try and update you need to specify the client_id, this will be what you were given when you initially registered the client.
131 client_secret is required to update.
132 When you try to update you need to specify the client_secrer, this will be what you were given when you initially register the client.
135 This is when you are trying to update however the client_id and/or client_secret you have submitted are incorrect.
137 Only set client_id for update.
138 This should only be given when you update.
140 Only set client_secret for update.
141 This should only be given when you update.
143 Logo URL <url> is not a valid URL
144 This is when the URL specified did not meet the validation.
146 contacts must be a string of space-separated email addresses.
147 ``contacts`` should be a string (not a list), ensure each email is seporated by a space
149 Email <email> is not a valid email
150 This is when you have submitted an invalid email address
152 redirect_uris must be space-separated URLs.
153 ``redirect_uris`` should be a string (not a list), ensure each URL is seporated by a space
155 URI <URI> is not a valid URI
156 This is when your URI is invalid.