Question

Removing refresh_token from response

  • 10 November 2019
  • 1 reply
  • 1344 views

Hi,

I am new to ringCentral and started to explore it.

What I can see that the apis like fax, messages are secured with oauth authentication. The oauth response contains access_token as well as the refresh_token something like this:

{    "access_token": "<access token>",    "token_type": "bearer",    "expires_in": 3600,    "refresh_token": "<refresh_token>",    "refresh_token_expires_in": 604800,    "scope": "<scope>",    "owner_id": "****",    "endpoint_id": "****"}

Now in our api we don't actually require the refresh_token and it is just junk huge value in the response and want to eliminate it from the response.

I have seen that can be done in other authentication apis. But not sure if I really can disable them in ringCentral.

What is the best way I can remove those from the response? Also if not can modify the expiration time of refres_token in ringCentral?


1 reply

This is quite easy. You can easily disable it by setting the TTL which is also called time to live for the refresh_token_ttl to 0

example: username=<your username>&password=<your password>&extension=101&grant_type=password&refresh_token_ttl=0

Just use refresh_token_ttl=0 in the OAuth request along with your other parameters like grant_type, extension etc.

Now in your response you will never see refresh_token as it will expired before it generate

You can also set the value to -1 i.e refresh_token_ttl=-1

Reply