Skip to content

Commit 475cb84

Browse files
committed
Add token redirect_uri error, fill out error responses
1 parent 6a6baf5 commit 475cb84

File tree

1 file changed

+32
-2
lines changed

1 file changed

+32
-2
lines changed

content/v3/oauth.md

Lines changed: 32 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,9 @@ registered callback URL with the following parameters summerizing the
205205
error:
206206

207207
http://your-application.com/callback?error=application_suspended
208+
&error_description=Your%20application%20has%20been%20suspended.%20Contact%[email protected].
209+
&error_uri=http://developer.github.com/v3/oauth/%23application-suspended
210+
&state=xyz
208211

209212
Please contact [support](https://github.com/contact) to solve issues
210213
with suspended applications.
@@ -216,6 +219,9 @@ with your application, GitHub will redirect to the registered callback
216219
URL with the following parameters summerizing the error:
217220

218221
http://your-application.com/callback?error=redirect_uri_mismatch
222+
&error_description=The%20redirect_uri%20MUST%20match%20the%20registered%20callback%20URL%20for%20this%20application.
223+
&error_uri=http://developer.github.com/v3/oauth/%23redirect-uri-mismatch
224+
&state=xyz
219225

220226
To correct this error, either provide a redirect_uri that matches what
221227
you registered or leave out this parameter to use the default one
@@ -228,6 +234,9 @@ the registered callback URL with the following parameters summerizing
228234
the error:
229235

230236
http://your-application.com/callback?error=access_denied
237+
&error_description=The%20user%20has%20denied%20your%20application%20access.
238+
&error_uri=http://developer.github.com/v3/oauth/%23access-denied
239+
&state=xyz
231240

232241
There's nothing you can do here as users are free to choose not to use
233242
your application. More often that not, users will just close the window
@@ -246,20 +255,41 @@ examples only show JSON responses.
246255
If the client\_id and or client\_secret you pass are incorrect you will
247256
receive this error response.
248257

249-
<%= json :error => :incorrect_client_credentials %>
258+
<%= json :error => :incorrect_client_credentials,
259+
:error_description => "The client_id and/or client_secret passed are incorrect.",
260+
:error_uri => "http://developer.github.com/v3/oauth/#incorrect-client-credentials"
261+
%>
250262

251263
To solve this error, go back and make sure you have the correct
252264
credentials for your oauth application. Double check the `client_id` and
253265
`client_secret` to make sure they are correct and being passed correctly
254266
to GitHub.
255267

268+
### Redirect URI mismatch(2)
269+
270+
If you provide a redirect_uri that doesn't match what you've registered
271+
with your application, you will receive this error message:
272+
273+
<%= json :error => :redirect_uri_mismatch,
274+
:error_description => "The redirect_uri MUST match the registered callback URL for this application.",
275+
:error_uri => "http://developer.github.com/v3/oauth/#redirect-uri-mismatch(2)"
276+
%>
277+
278+
To correct this error, either provide a redirect_uri that matches what
279+
you registered or leave out this parameter to use the default one
280+
registered with your application.
281+
256282
### Bad verification code
257283

258284
If the verification code you pass is incorrect, expired, or doesn't
259285
match what you received in the first request for authorization you will
260286
receive this error.
261287

262-
<%= json :error => :bad_verification_code %>
288+
<%= json :error => :bad_verification_code,
289+
:error_description => "The code passed is incorrect or expired.",
290+
:error_uri => "http://developer.github.com/v3/oauth/#bad-verification-code"
291+
%>
292+
263293

264294
To solve this error, start the [OAuth process over from the beginning](#redirect-users-to-request-github-access)
265295
and get a new code.

0 commit comments

Comments
 (0)