Why is Google Oauth returning `invalid redirect_urI` in my Rails app?

前端 未结 7 1762
一生所求
一生所求 2020-12-04 11:32

I\'m adding Google Oauth2 to a Rails app, but have been unable to get past the early stages.

I\'ve set up an app, and defined client ID and secret.But I\'m getting <

相关标签:
7条回答
  • 2020-12-04 12:05

    For anyone else finding this, my problem was combination of several things.

    1. I could not get callbacks to work on a local machine. The console API console suggests it is possible, but I couldn't get it working. Not sure of this is down to the service, or to my network/ connection/ firewall/ etc.

    2. In the API console you must specify the full redirect URI, not just the root url back to your app.

    3. Google lists scope parameters here https://developers.google.com/gdata/faq#AuthScopes. It seems this information is outdated, and the correct format for these is now https://www.googleapis.com/auth/plus.me, https://www.googleapis.com/auth/youtube, etc. Maybe someone else can confirm this?

    I had a few other things going on as well. I had written a full explanation on another of my questions here on SO. Unfortunately my comments were deleted instead of moved by a moderator because I posted in the wrong place. I can't now remember all that I wrote. For others facing similar issue, feel free to comment, it may jog my memory so I can offer some ideas.

    0 讨论(0)
提交回复
热议问题