Google OAuth 2 authorization - Error: redirect_uri_mismatch

前端 未结 30 1841
遥遥无期
遥遥无期 2020-11-22 02:58

On the website https://code.google.com/apis/console I have registered my application, set up generated Client ID: and Client Secret to my a

相关标签:
30条回答
  • 2020-11-22 03:26

    When you register your app at https://code.google.com/apis/console and make a Client ID, you get a chance to specify one or more redirect URIs. The value of the redirect_uri parameter on your auth URI has to match one of them exactly.

    0 讨论(0)
  • 2020-11-22 03:28

    If you're using Google+ javascript button, then you have to use postmessage instead of the actual URI. It took me almost the whole day to figure this out since Google's docs do not clearly state it for some reason.

    0 讨论(0)
  • 2020-11-22 03:32

    Make sure to check the protocol "http://" or "https://" as google checks protocol as well. Better to add both URL in the list.

    0 讨论(0)
  • 2020-11-22 03:32

    I needed to create a new client ID under APIs & Services -> Credentials -> Create credentials -> OAuth -> Other

    Then I downloaded and used the client_secret.json with my command line program that is uploading to my youtube account. I was trying to use a Web App OAuth client ID which was giving me the redirect URI error in browser.

    0 讨论(0)
  • 2020-11-22 03:35

    This seems quite strange and annoying that no "one" solution is there. for me http://localhost:8000 did not worked out but http://localhost:8000/ worked out.

    0 讨论(0)
  • 2020-11-22 03:35

    The main reason for this issue will only come from chrome and chrome handles WWW and non www differently depending on how you entered your URL in the browsers and it searches from google and directly shows the results, so the redirection URL sent is different in a different case

    Add all the possible combinations you can find the exact url sent from fiddler , the 400 error pop up will not give you the exact http and www infromation

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