Google Analytics OAuth2: How to solve error: “redirect_uri_mismatch”?

前端 未结 3 556
眼角桃花
眼角桃花 2020-12-06 22:55

I\'m trying to get this example to work: https://developers.google.com/analytics/devguides/config/mgmt/v3/quickstart/web-php#enable

The error I\'m getting is \"Error

相关标签:
3条回答
  • 2020-12-06 23:11

    The redirect Uri in the request MUST be exactly the same as one Uri you stored.

    I see a / at the end of the stored one you missed in your request.

    0 讨论(0)
  • 2020-12-06 23:21

    Remember, as far as Google is concerned, "your" server is hostile until you name it "friendly", you must explicitly whitelist every possible source of an OAuth call TO Google.

    Google is a clubbouncer, a big, ugly, unmovable bouncer with a a guest list saying to your application: "I will only deal with your request if your exact name OR id is on the list"

    Have you tried including, not only localhost, but all other possible origins?

    You must list every possible variation of url "root", including explicit IPs.

    http://www.example.com
    http://example.com
    https://example.com
    https://www.example.com
    http://222.111.0.111
    ...
    

    dont forget to include

    https://accounts.google.com:443

    0 讨论(0)
  • 2020-12-06 23:28

    just copy the request URI on which error is occurring from error screen and paste it to OAuth credentials "Authorised redirect URIs"

    now run the app. this works for me. Hope I answered your query.

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