Solved

Password to Oauth2.0

  • 9 February 2024
  • 2 replies
  • 116 views

  • Participating Frequently
  • 8 replies

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.

icon

Best answer by Phong1426275020 9 February 2024, 20:53

View original

2 replies

Userlevel 1

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.

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.

Reply