Question

Get Token using oAuth

  • 1 May 2018
  • 3 replies
  • 5030 views

Use FileMaker Insert URL with the following and continually get "{ "error": "unauthorized_client",

"error_description": "Unauthorized for this grant type",

"errors": [

{


"errorCode": "OAU-251",

"message": "Unauthorized for this grant type"

}

]

}"


Insert from URL [ $result; "https://platform.devtest.ringcentral.com/restapi/oauth/token"; cURL options: " --basic " & // clientId:clientSecret"-u " & "*******:*******" & "-H " & Quote ( "Accept:application/json" ) &

"-H " & Quote ( "Content-Type:application/json" ) &

"-X POST " &

"-d 'grant_type=password&username=**********&extension=101&password=****'" ]




3 replies

The most common reason for seeing this error "OAU-251 Unauthorized for this grant type" is because you are using the OAuth 2.0 Password Flow (grant_type=password) but your app is not configured for this.

Password Flow must be configured in your app and can only be applied to private apps, no UI apps. This is because other OAuth 2.0 flows (e.g. Authorization Code Flow and Implicit Grant) are designed for other apps.

To configure your app for Password Flow, follow the instructions here which has a nice animated screenshot of the Developer Portal configuration screen.

https://stackoverflow.com/questions/47692828/ringcentral-auth-token-failed-in-curl-call/47745436#477...
Success has been accomplished.

Went with Password Flow and things are fine.

Thanks.

If you're using an OAuth 2.0 request using the OAuth 2.0 password grant (grant_type=password), then your application you created should in the RingCentral Developer Portal should be Password flow .

Here is wonderful way it has answered with animated Gif image that will easily help you to understand the proccess: https://stackoverflow.com/questions/47692828/ringcentral-auth-token-failed-in-curl-call-unauthorized-for-this-grant-type/47745436#47745436


Please note, application created with different platform type will have different grant_type.

For example, application created for platform type = browser based will have grant_type=Authorization Code | Implicit | Refresh Access Token where as application for platform type = Desktop/Windows will have grant_type= Authorization Code | Password flow |Refresh Access Token

So in order to use (grant_type=password) you need to have application created with platform type that support Password flow


Reply