Skip to main content
The First Step
July 2, 2017
Question

Authorize API with Web Application Failed

I am trying to connect my web app to ringcentral for sending Fax but i am unable to authorize my application to ringcentral.When i am trying to run sample GIT folder it is giving unauthorized error.

Test 1: authData.php Auth exception: Refresh token has expired Exception: Unauthorized for this grant type SDK HTTP Error at https://platform.devtest.ringcentral.com/restapi/oauth/token Response text: { "error" : "unauthorized_client", "error_description" : "Unauthorized for this grant type", "errors" : [ { "errorCode" : "OAU-251", "message" : "Unauthorized for this grant type" } ] } Previous: Response has unsuccessful status



#Windows #PHP



6 replies

Employee
July 3, 2017
The key message is "Unauthorized for this grant type".

Please check your app to make sure it supports the grant type.

Ref: https://github.com/ringcentral/ringcentral-php/issues/39#issuecomment-242907546 
The First Step
July 3, 2017
See it is not showing the password flow option..... Please help me 

Employee
July 4, 2017

If it's a sandbox app, you can simply create a new app instead to enable password flow.

By the way, public app doesn't support password flow.

If you have difficulty configuring it, please contact the developer support team or submit a support ticket.

The First Step
July 5, 2017
Can you help me how to resolve this ?


The First Step
June 18, 2019

This a common issue user face. Similar type of question raised here.

More precisely discussed here.

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 .

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

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

The First Step
July 11, 2019