question

sattar k avatar image
sattar k asked Phong Vu answered

Unable to Authorize to the ringcentral using restapi/oauth/token API

Hello,

We are using the endpoint (https://platform.devtest.ringcentral.com/restapi/oauth/token?username=19294732631&password=****&extension=101&grant_type=password) to get the access token in the response.

In header I am passing some information and in the value of Authorization is passed in (Basic + base64_encoded(Client ID : Client Secret) format.

1699969847763.png

I am getting the error invalid_client.

1699971495740.png

Can you suggest us, how to get the access token in response for authorization.

oauth2
1699969847763.png (30.6 KiB)
1699971495740.png (18.1 KiB)
1 |3000

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

Phong Vu avatar image
Phong Vu answered sattar k commented

Based on the error description, the app client id you provided is for the sandbox environment. Then in the header you set the Host server URL to the production server. You should change the host to platform.devtest.ringcentral.com or if you try to authenticate a user under your production account, make sure that your app is graduated to the production and use the app client id/secret for the production environment.

Also, you will need to start using JWT auth flow instead of using username/password.

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.

sattar k avatar image sattar k commented ·

Thanks for correcting us with the host details but can you please help us with the new error -

1700043549468.png


0 Likes 0 ·
1700043549468.png (49.3 KiB)
Phong Vu avatar image
Phong Vu answered

Your app does not support username/password auth flow (and RingCentral will stop supporting it as well).

Either implement code flow or generate a JWT token and use with this app. Check this PostMan collections to learn how to authenticate using JWT token.

https://www.postman.com/ringcentral1/workspace/ringcentral-platform-public-test

1 |3000

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

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