question

Dilip Kunder avatar image
Dilip Kunder asked Anirban Sen Chowdhary answered

Removing refresh_token from response

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?

oauth
1 |1000

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

1 Answer

·
Anirban Sen Chowdhary avatar image
Anirban Sen Chowdhary answered

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

1 |1000

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.