question

Guy Clifton avatar image
Guy Clifton asked Guy Clifton commented

Actin - Prod Refresh token issue

Looks like both auth token and refresh token has expired. Please suggest how to get new token.

Application name is ‘Actin’ and client_id is ‘LKszrWSjS26fhbXY7xB9Kw’

authentication
1 |3000

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

Phong Vu avatar image
Phong Vu answered

When both access token and refresh token expire, you have to re-authenticate (login) and that is all you need to do. It is the same as after you logout, then you re-login.

1 |3000

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

Guy Clifton avatar image
Guy Clifton answered Guy Clifton commented

1621360797136.png (19.3 KiB)
2 comments
1 |3000

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

Phong Vu avatar image Phong Vu ♦♦ commented ·

What is the "that is invalid"? The code? How do you use the code to exchange for a token?

0 Likes 0 ·
Guy Clifton avatar image Guy Clifton Phong Vu ♦♦ commented ·

We then pass the code to this ring central rest client method.

using RingCentral.Client.2.3.4\lib\RingCentral.dll 
public Task<TokenInfo> Authorize(string authCode, string redirectUri);.


0 Likes 0 ·
Guy Clifton avatar image
Guy Clifton answered Guy Clifton commented

this is response i am getting using refresh token through postman.

{
"error": "invalid_grant",
"errors": [
{
"errorCode": "OAU-212",
"message": "Token type mismatch"
}
],
"error_description": "Token type mismatch"
}


12 comments
1 |3000

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

Phong Vu avatar image Phong Vu ♦♦ commented ·

There must be something incorrect in the way you authenticate or using the code to exchange for tokens. What endpoint you use in Postman to get the token? What language is your app actually written in?

0 Likes 0 ·
Guy Clifton avatar image Guy Clifton Phong Vu ♦♦ commented ·

Language is C# dot net.

Endpoint: https://platform.ringcentral.com/restapi/oauth/token.

1621390635958.png

0 Likes 0 ·
1621390635958.png (33.9 KiB)
Phong Vu avatar image Phong Vu ♦♦ Guy Clifton commented ·

Why you called the "/oauth/token" endpoint with those params? That is for getting a new access token using a refresh token.

In this case, you are logging in and you just get the code. You have to use the code to exchange for tokens.

- The grant_type must be set to "authorization_code"

- The code must be set with the code value you get in the call back

See this reference for more explanation.

0 Likes 0 ·
Show more comments

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