Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not include query params in callback URLs #73

Merged
merged 1 commit into from
May 23, 2017
Merged

Do not include query params in callback URLs #73

merged 1 commit into from
May 23, 2017

Conversation

volmer
Copy link
Contributor

@volmer volmer commented May 19, 2017

In order to be compatible with GitHub Integration's Oauth flow the callback URL must match the same one provided in the integration's settings page. The current callback_url method includes any query params received previously, which causes a mismatch, and GitHub returns "406 Not Accepted" with an error message:

(github) Callback phase initiated.
(github) Authentication failure! invalid_credentials: OAuth2::Error,
redirect_uri_mismatch: The redirect_uri MUST match the registered callback URL
for this application.
error=redirect_uri_mismatch&error_description=The+redirect_uri+MUST+match+
the+registered+callback+URL+for+this+application.&error_uri=https%3A%2F%2
Fdeveloper.github.com%2Fv3%2Foauth%2F%23redirect-uri-mismatch2

For more information:
https://developer.github.com/early-access/integrations/user-identification-authorization

Fixes #72

In order to be compatible with GitHub Integration's Oauth flow the callback URL
must match the same one provided in the integration's settings page. The current
`callback_url` method includes any query params received previously, which
causes a mismatch, and GitHub returns "406 Not Accepted" with an error message:

```
(github) Callback phase initiated.
(github) Authentication failure! invalid_credentials: OAuth2::Error,
redirect_uri_mismatch: The redirect_uri MUST match the registered callback URL
for this application.
error=redirect_uri_mismatch&error_description=The+redirect_uri+MUST+match+
the+registered+callback+URL+for+this+application.&error_uri=https%3A%2F%2
Fdeveloper.github.com%2Fv3%2Foauth%2F%23redirect-uri-mismatch2
```

For more information:
https://developer.github.com/early-access/integrations/user-identification-authorization
@volmer
Copy link
Contributor Author

volmer commented May 21, 2017

GitHub has confirmed that this is indeed the expected behaviour: https://platform.github.community/t/oauth-flow-with-integration-406-not-acceptable/1775/8 (last comment)

@volmer
Copy link
Contributor Author

volmer commented May 23, 2017

@tmilewski any thoughts on this?

@tmilewski
Copy link
Member

@volmer I'll be able to look through this a little later today. Thanks!

@tmilewski
Copy link
Member

Woof, params like state are used to prevent CSRF issues.

It is what it is. I'll pull it down, make sure everything is green and cut a build.

Thanks for handling this!

@tmilewski tmilewski merged commit 1888397 into omniauth:master May 23, 2017
@volmer
Copy link
Contributor Author

volmer commented May 23, 2017

🎉

@tmilewski
Copy link
Member

It's live as 1.3.0, thanks again! https://rubygems.org/gems/omniauth-github

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants