question

gerard-beutler10011 avatar image
gerard-beutler10011 asked Anirban edited

Get Token using oAuth

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=****'" ]



getting started
1 |1500 characters needed characters left characters exceeded

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

John Wang avatar image
John Wang answered
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...
1 |1500 characters needed characters left characters exceeded

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

gerard-beutler10011 avatar image
gerard-beutler10011 answered
Success has been accomplished.

Went with Password Flow and things are fine.

Thanks.
1 |1500 characters needed characters left characters exceeded

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

Anirban avatar image
Anirban answered Anirban edited

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


1 |1500 characters needed characters left characters exceeded

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