question

Ismael Torres avatar image
Ismael Torres asked Ismael Torres commented

Password to Oauth2.0

I have been using the password flow just fine, however RingCentral will deprecate it and I am moving to Oauth2.0. However I am running into issue and I keep getting the error OAU-250 Unsupported grant type.

This is the URL I am using:
POST Request: https://platform.ringcentral.com/restapi/oauth/token

Params:

grant_type = authorization_code

redirect_uri = url

code = code gotten back from the url

client_id = client_id


Headers:

Content-Type = application/x-www-form-urlencoded

Accept = application/json

Authorization = Basic (base64encode"clientid:clientsecret")

Any feedback is well appreciated.

oauth2
1 |3000

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

1 Answer

Phong Vu avatar image
Phong Vu answered Ismael Torres commented

Normally you should migrate from Password flow to JWT flow, which is kind of equivalent and suitable for Server/No UI app platform type.

If you really want to change the authentication to OAuth 2.0 code flow, the best option is to register a new app with code flow with a specified the Redirect URI and you will need to implement extra code to handle the authorization.

6 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.

Ismael Torres avatar image Ismael Torres commented ·

Ok I updated, the settings of my console to use JWT, I then using Postman (for testing) used this URL: https://platform.ringcentral.com/restapi/oauth/token

POST Request


Headers:

Content-Type = application/x-www-form-urlencoded

Authorization = Basic (base64encode"clientid:clientsecret")


Params:

assertion = my JWT token I generated under credentials

grant_type = urn:ietf:params:oauth:grant-type:jwt-bearer

( Note I also tried : grant_type = urn%3Aietf%3Aparams%3Aoauth%3Agrant-type%3Ajwt-bearer )


However this is the error I get which is the exact same error I got when using OAuth 2.0:


{ "error" : "invalid_request" , "errors" : [ { "errorCode" : "OAU-250" , "message" : "Unsupported grant type" } ], "error_description" : "Unsupported grant type" }


I am using cURL, because I am using the FileMaker platform, thanks in advance for any advice.

0 Likes 0 ·
Phong Vu avatar image Phong Vu ♦♦ Ismael Torres commented ·

What is the app client id?

0 Likes 0 ·
Ismael Torres avatar image Ismael Torres Phong Vu ♦♦ commented ·

0eLTUWdZfWzd1aTmBEUteZ

0 Likes 0 ·
Show more comments
Show more comments

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