question

Kenny FONG avatar image
Kenny FONG asked ·

Intermittent error OAU-213 Token not Found error when refreshing using .Net library

Hi


I am using the .Net library as I am getting an intermittent error when using the await rc.Refresh() method where rc is RestClient. I call the refresh method before the token has expired.

The response I get when it has errored is:

Response:
StatusCode: 400, ReasonPhrase: 'Bad Request', Version: 1.1, Content: System.Net.Http.StreamContent, Headers:
{
  Connection: keep-alive
  X-Application-Context: application:8080
  RCRequestId: ba572a7c-357f-11eb-b754-005056b58a26
  Pragma: no-cache
  AceRoutingKey: ams01-c01-ace02.75bacc1c-0756-11eb-a2dd-005056b5fcaa
  RoutingKey: ZRH01P32
  Cache-Control: no-store
  Date: Thu, 03 Dec 2020 15:53:46 GMT
  Server: nginx
  Content-Length: 161
  Content-Language: en
  Content-Type: application/json; charset=utf-8
}
Content: {
  "error" : "invalid_grant",
  "errors" : [ {
    "errorCode" : "OAU-213",
    "message" : "Token not found"
  } ],
  "error_description" : "Token not found"
}

I am wondering if you can help? This doesn't happen all the time and generally the token refresh is done every 59 minutes

refresh access tokenauth.net sdk.net
1 |1000 characters needed characters left characters exceeded

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

1 Answer

· Write an Answer
Tyler Liu avatar image
Tyler Liu answered ·

What is your SDK version?

Instead of refresh 59 minutes, refresh every 30 minutes.


There is a 5-active-tokens limit. So if you are requesting tokens too frequently, old ones will be invalidated, thus "not found".

1 |1000 characters needed characters left characters exceeded

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

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

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

Work together.
From anywhere.

Team messaging, video meetings
and phone - all in one app.


Get the new RingCentral app