question

gerard-beutler avatar image
gerard-beutler asked ·

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


topic-default
1 |1000 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...
Share
1 |1000 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-beutler avatar image
gerard-beutler answered ·
Success has been accomplished.

Went with Password Flow and things are fine.

Thanks.
Share
1 |1000 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 Sen Chowdhary avatar image
Anirban Sen Chowdhary answered ·

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


Share
1 |1000 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.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

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