Can't get token on new sandbox application
Tags: sandbox
Jul 22, 2016 at 8:43am • 4 replies • 0 likes
travis-carona
I am adding new permissions to our app. Per previously asked questions, I saw that we should create a new app and use that before we merge the new permissions in. So, I created a new app. This app is identical to the old app except for it has new key/secret. All usernames/extensions/passwords are the same.
THE PROBLEM:
When i send a /restapi/oauth/token request with the CURRENT encoded key/secret it works fine, BUT with the new encoded key/secret, I get the following:
{"error":"unauthorized_client","error_description":"Unauthorized for this grant type"}
4 Answers
This change was made since the creation of your first application (which was created back in January) to improve security of applications.
For applications which require an admin-role backend (without any UI, and capturing data from the RingCentral API which needs an admin role to obtain), I would create a new application that has the Platform Type set to "Server Only (No UI)". This type will give you the AuthN flow you have in your existing application code (should not require any changes to your existing auth code).
For applications which require an admin-role backend (without any UI, and capturing data from the RingCentral API which needs an admin role to obtain), I would create a new application that has the Platform Type set to "Server Only (No UI)". This type will give you the AuthN flow you have in your existing application code (should not require any changes to your existing auth code).
0
What is the Platform Type of the newly created application please?
If it is anything other than "Server Only (No UI)" then what the error relates to is the fact that you must implement the Authorization Flow (3-Legged OAuth) for your application instead of the ROPC (Password Credentials Flow).
3-Legged OAuth (Authorization Flow) is implemented in multi-tenant applications, such as CRM integrations.
2-Legged OAuth (Password Credentials Flow) is implemented only in single-tenant (admin only) integrations, such as an account-wide call-log data archiving integration.
You can quickly determine which type of authentication your application needs to implement by:
1. Logging into the Developer Portal: https://developers.ringcentral.com
2. Find and open your application from within the "My Apps" page
3. Open the "Settings" section for your application
4. View "App Type & Platform" to see the settings for your applications Platform Type
5. View "OAuth Settings" to know which type of Authentication flow your app needs to implement (this is defined by the Platform Type)
For example, the screenshot below shows what a 3-Legged OAuth (Authorization Flow) type application might see in the Developer Portal...
Here are some helpful demos (in multiple languages) for implementing 3-Legged OAuth with RingCentral:
https://github.com/grokify/ringcentral-demos-oauth
If it is anything other than "Server Only (No UI)" then what the error relates to is the fact that you must implement the Authorization Flow (3-Legged OAuth) for your application instead of the ROPC (Password Credentials Flow).
3-Legged OAuth (Authorization Flow) is implemented in multi-tenant applications, such as CRM integrations.
2-Legged OAuth (Password Credentials Flow) is implemented only in single-tenant (admin only) integrations, such as an account-wide call-log data archiving integration.
You can quickly determine which type of authentication your application needs to implement by:
1. Logging into the Developer Portal: https://developers.ringcentral.com
2. Find and open your application from within the "My Apps" page
3. Open the "Settings" section for your application
4. View "App Type & Platform" to see the settings for your applications Platform Type
5. View "OAuth Settings" to know which type of Authentication flow your app needs to implement (this is defined by the Platform Type)
For example, the screenshot below shows what a 3-Legged OAuth (Authorization Flow) type application might see in the Developer Portal...
Here are some helpful demos (in multiple languages) for implementing 3-Legged OAuth with RingCentral:
https://github.com/grokify/ringcentral-demos-oauth
0
A new Community is coming to RingCentral!
Posts are currently read-only as we transition into our new platform.We thank you for your patience
during this downtime.
Try Workflow Builder
Did you know you can easily automate tasks like responding to SMS, team messages, and more? Plus it's included with RingCentral Video and RingEX plans!Try RingCentral Workflow Builder