News & Announcements User Community Developer Community

Welcome to the RingCentral Community

Please note the community is currently under maintenance and is read-only.

Search
Make sure to review our Terms of Use and Community Guidelines.
  Please note the community is currently under maintenance and is read-only.
Home » Developers
Actin - Prod Refresh token issue
Tags: authorization
May 18, 2021 at 7:33am   •   3 replies  •  0 likes
Guy Clifton

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’

3 Answers
answered on May 18, 2021 at 11:59am  

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"
}



 0
on May 18, 2021 at 1:42pm   •  0 likes

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?

on May 18, 2021 at 7:17pm   •  0 likes

Language is C# dot net.

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

1621390635958.png

on May 18, 2021 at 8:40pm   •  0 likes

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.

on May 19, 2021 at 9:04am   •  0 likes

I did that but it says account does not exist.


this is the account number 18478076161

client id : LKszrWSjS26fhbXY7xB9Kw

1621440174775.png

on May 19, 2021 at 9:29am   •  0 likes

Again, it must be messed up somewhere.

You said you are using C# .NET, why you show me Postman. What is the reason of mixing the authorization process?

on May 19, 2021 at 10:17am   •  0 likes

Shared postman here for an example. there is no mixing of process happening. after getting code. application is making call to below method of ring central client and throwing exception.

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

this is client object:
1621443846517.png

this is token object:

1621443989627.png

this is the exception message contain request body and post url

POST https://platform.ringcentral.com/restapi/oauth/token failed. An error occurred while sending the request.
Request body:
grant_type=authorization_code&redirect_uri=http%3A%2F%2Flocalhost%3A59236%2FAccount%2FAuthorizeRingCentralCallBack&code=SUFEMDFQMTZQQVMwMHxBQUJBaUpZcmlPZ3pacVE2Z2hGenlEY0V6OXU4UjRnOFNFVVV1Ql9DT1dkTFBvS3ZPSUM3a29aSHRWSGRrc25aVV9ETGRlZkd1RVRPdVdIei1UaVA0MjNfWl8tTjNkZkFPLW5xNjVJRnJMU0d1S0xUU3BhV3MzY0xNMVlWeHZUUThaNWM5UGxqTkEzcnJlMkFDOHZJbWhnVDU0cjNEV3d1YlhnTXxCRzdNN1F8Z1VHSFRRRlZpNjc5RVoxd0k2TUFGd3xBUQ&access_token_ttl=3600&refresh_token_ttl=604800


on May 19, 2021 at 11:11am   •  0 likes

It looks like you are using the very old .NET SDK. Can you check and update using the latest SDK version 5.x.x?

https://github.com/ringcentral/RingCentral.Net

on May 19, 2021 at 11:56am   •  0 likes

I can't do it right away. we are not even on RingCentral.Net https://www.nuget.org/packages/RingCentral.Net/ we are on RingCentral.Client https://www.nuget.org/packages/RingCentral.Client/ and latest stable version of that is 3.0.0.

on May 19, 2021 at 12:25pm   •  0 likes

Response is coming null in application.

1621452126925.png

so can you please check why its saying "Account does not exist" from postman. I can share Authorization header information separately by which ever means. I think issue is with using account credentials but how its validating those credentials.

on May 19, 2021 at 1:50pm   •  0 likes

can you please check what error is getting logged at your end with this call. we can go from there at least for now.

on May 19, 2021 at 10:20pm   •  0 likes

Issue is fixed. thanks

on May 19, 2021 at 12:18pm   •  0 likes

The RingCentral.Client is very old and there is no update to that package for years. Once you have time to port, please port your code to use the latest .NET

answered on May 18, 2021 at 8:32am  

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.


 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

PRODUCTS
RingEX
Message
Video
Phone
OPEN ECOSYSTEM
Developer Platform
APIs
Integrated Apps
App Gallery
Developer support
Games and rewards

RESOURCES
Resource center
Blog
Product Releases
Accessibility
QUICK LINKS
App Download
RingCentral App login
Admin Portal Login
Contact Sales
© 1999-2024 RingCentral, Inc. All rights reserved. Legal Privacy Notice Site Map Contact Us