-
-
Notifications
You must be signed in to change notification settings - Fork 416
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
I am getting Error: redirect_uri_mismatch in rails 5 even all the uris are setup correctly. #250
Comments
I will need more details. Please provide logs, and describe your setup. |
gem 'omniauth-google-oauth2' In devise.rb redirect-uri Now when trying to get login with google I am getting: Redirect uri mismatch error. Logs are fine nothing wrong in backend here are my logs: Started GET "/users/sign_in" for 127.0.0.1 at 2016-09-19 07:33:52 -0700 Started GET "/users/auth/google_oauth2" for 127.0.0.1 at 2016-09-19 07:33:54 -0700 FOR YOUR INFORMATION |
Now to just be clear, you did add the authorized redirect URI's to Google? You must make sure they have been added here: https://console.developers.google.com/ Just make sure you have edited the Authorized Redirect URIs in the Credentials section. |
@zquestz: Already mentioned All the uri are correct. Also implemented omniauth-facebook which is working perfectly. |
Can you try with 127.0.0.1 instead of localhost? Curious if that resolves your issue. Sometimes localhost can resolve in odd ways and trigger this error. |
Already tried Still same issue. |
Can you test with the included example application? Just bind it to the same port and confirm that also doesn't work? That way we can make sure your setup is valid and that the issue really is with Rails 5 (which I have working fine locally...) |
Same error with Rails 5 setup. I am testing locally with ngrok setup and it worked fine the first time around, but when I just went to do it with a new ngrok link it doesn't work. It's like it's caching the original link for the redirect_uri. I made sure the link was updated in Google's developer console so it's an error from there. Old ngrok link: http://f36f7183.ngrok.io But when I go to sign in with Google here's the link it takes it to: As you can see it's still showing the old redirect_uir in there: 3Dhttp://f36f7183.ngrok.io/users/auth/google_oauth2/callback which is causing an error with Google since obviously that redirect_uri does not match what's in Google anymore. Is there a solution? Or do I have to manually over-ride the redirect_uri now? |
There is no caching at all in the gem so I have no idea what could be causing this for you. I would go ahead and over-ride the redirect_uri, but that should not be necessary. |
@zquestz: Did you find any solution? |
I can't replicate this, and I don't do any special handling for the redirect_url. For now I would just pass the correct redirect_uri when passing options to the strategy.
|
One thing that I noticed is that if my auth path is like I believe it has nothing to do with |
Had a similar problem when providing scopes in the devise initializer. But when I remove all options, it works.
Update: My issue turned out to only appear when the
|
Thanks for the feedback @Brotakuu. This will be useful for people to know! |
@ashutosh-singh-rawat did you get it working? Safe to close this? |
Assuming issue is resolved. Can reopen if needed. |
@zquestz: Its working fine. |
Hi Josh, I´m trying to include Google Authentication to my app, but I´m getting: |
Probably the issue is with dependency similar to #204 |
No description provided.
The text was updated successfully, but these errors were encountered: