atmos / warden-github

:lock: warden strategy for github oauth

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Redirect URI Mismatch

atmos opened this issue · comments

@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

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

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?

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

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?

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.