Get Token using oAuth

  • 1
  • Question
  • Updated 4 months ago
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=****'" ]
Photo of Gerard Beutler

Gerard Beutler

  • 80 Points 75 badge 2x thumb

Posted 4 months ago

  • 1
Photo of John Wang

John Wang, Official Rep

  • 5,436 Points 5k badge 2x thumb
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...
Photo of Gerard Beutler

Gerard Beutler

  • 80 Points 75 badge 2x thumb
Success has been accomplished.

Went with Password Flow and things are fine.

Thanks.