atmos / warden-github

:lock: warden strategy for github oauth
MIT License
54 stars 41 forks source link

Redirect URI Mismatch #22

Closed atmos closed 11 years ago

atmos commented 11 years ago

@fphilipe running the example app gives me a 404 now. Any ideas?

127.0.0.1 - - [05/Feb/2013 00:51:32] "GET /auth/github/callback?error=redirect_uri_mismatch HTTP/1.1" 404 456 0.0020
fphilipe commented 11 years ago

Does the callback host specified in the GitHub API match? Just checked locally and it's working for me.

fphilipe commented 11 years ago

OK, I know what it is. If you specify a path in the callback inside GitHub application settings it will report a mismatch. So the solution is to just specify the host.

Pretty sure this is a recent change. Did you guys modify anything in the host matching logic inside the GitHub API?

atmos commented 11 years ago

Nope, older app config pointing to a path that doesn't exist anymore.

fphilipe commented 11 years ago

Nevertheless, I think this behavior is inconsistent with the API docs. From the docs:

The redirect_uri parameter is optional. If left out, GitHub will redirect users to the callback URL configured in the OAuth Application settings. If provided, the redirect URL must match the callback URL’s host.

So if you have an app callback configured to http://host.com/foobar I should still be able to specify a redirect_uri that points to http://host.com/login, right?

atmos commented 11 years ago

Yup, at least I think so. I was testing with an older app that had a pre-configured callback url. Setting up a new one that just pointed to / fixed me up. Kind of a shitty regression though.