question

Ho Trung avatar image
Ho Trung asked Yatin Gera answered

Google: Authorization - Error - redirect_uri_mismatch

I am in Authorization Code Flow to get access token. i tried to sign in with Google but it gave me an error: "Authorization Error Error 400: redirect_uri_mismatch You can't sign in to this app because it doesn't comply with Google's OAuth 2.0 policy. If you're the app developer, register the redirect URI in the Google Cloud Console." so How to setup correct redirect URL for Google? or what should i do to solve it?. Thanks

screen-shot-2022-04-07-at-111013.png

authenticationoauth2google
2 comments
1 |3000

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

Could you share more details on what you are doing?
In general, OAuth works where there is an OAuth Authorization Server that will authorize the app and provide the access token that can be used to fetch resources from the Resource Server.

In this case, the Authorization Server is the RingCentral Authorization Server server.
This is how you can authorize against the RingCentral Authorization Server
https://developers.ringcentral.com/guide/authentication/quick-start#javascript

1 Like 1 ·
Ho Trung avatar image Ho Trung Yatin Gera ♦♦ ·

Thank you for your reply Yatin Gera.

In my application, I want the Authorization Server to be RingCentral (Authorization Code Flow) to get the access token so that the next api can be called, e.g. "/restapi/v1.0/account/~/extension". I have set OAuth redirect URI in my app settings

When i sign in with the email account i registered in developers.ringcentral.com everything works fine but i sign in with google account it gives me the above error



0 Likes 0 ·

1 Answer

Yatin Gera avatar image
Yatin Gera answered

Hi @Ho Trung
The "Sign in with Google" on the developers.ringcentral.com is for signing in to the portal and not for your app to be able to consume the API.
When you need to consume any RingCentral API, you need to get an access token
For getting the access token, there are multiple ways and one of them is OAuth.
What that means is that you need an app that will implement auth flow as explained here
https://developers.ringcentral.com/guide/authentication/quick-start#javascriptdepending on what language you are writing to code your app.
After implementing authentication, you will be the access token and you can use that to fetch resources.
You should be able to find examples in the guide https://developers.ringcentral.com/guide

Hope this is helpful.

Thanks,

Yatin

1 comment
1 |3000

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

Hi @Yatin Gera
Ok I got it . Thank you a lot

0 Likes 0 ·

Developer sandbox tools

Using the RingCentral Phone for Desktop, you can dial or receive test calls, send and receive test SMS or Fax messages in your sandbox environment.

Download RingCentral Phone for Desktop:

Tip: switch to the "sandbox mode" before logging in the app:

  • On MacOS: press "fn + command + f2" keys
  • On Windows: press "Ctrl + F2" keys