0

I have a webapp that uses google authentication. When I click on the login, it gets the following error:

The redirect URI in the request, http://campus-study-2019.appspot.com/oauth2callback, does not match the ones authorized for the OAuth client. To update the authorized redirect URIs, visit: https://console.developers.google.com/apis/credentials/oauthclient/477760217336-q6bdhcdqvsrf56kaa7k0ifennf775lug.apps.googleusercontent.com?project=477760217336

When I try to add http://campus-study-2019.appspot-preview.com/oauth2callback to my Authorized redirect URIs in the Google Cloud platforms. I get the following:

Invalid Redirect: You are using a sensitive scope. URI must use https:// as the scheme.

Does anyone have any idea?

However, previously (1-2 months ago) I could easily add http in the list of authorized redirect URIs

Bonzo
  • 407
  • 2
  • 8
  • 23

2 Answers2

0

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

& or &?

trailing slash(/) or open ? (CMD/CTRL)+F, search for the exact match in the credential page. If not found then search for the missing one.

Wait until google refresh it. May happen in each half an hour if you are changing frequently or it may stay in the pool.

For your reference, please check the below link where you could check other options about your issue: Google OAuth 2 authorization - Error: redirect_uri_mismatch

Shafiq I
  • 286
  • 1
  • 7
0

The error is due to there being at least one restricted scope added to the project where the OAuth client ID resides.

enter image description here

You can see the set scopes for Google APIs by going to your project in the Developers Console -> APIs & Services -> OAuth consent screen. To fix the error there are two options:

  1. Remove the restricted scopes from the project (there will be a warning icon next to them on the OAuth consent screen page)
  2. Add only HTTPS URLs as authorized restricted URIs (https://campus-study-2019.appspot-preview.com/oauth2callback in this case)
ZUKINI
  • 125
  • 2
  • 12