How can I set the expiration time of an access token?
Using the Manager’s interface, you can configure the expiration time of an access token when registering a token, by filling in the field Expires In with a value in seconds. However, bear in mind that the value entered in the field will not be respected if there is a conflict with the token expiration value configured in the API being consumed.
More specifically, this is the behaviour followed:
-
The Expires In field can be left blank. In this case, the access token’s expiration value will be the one inserted in the registration data of the API the token will be linked to. If this value is also blank, the default expiration time will be used (configured in
). -
If there’s a value entered in the token’s registration and it is different from the value entered in the API registration, the value in the API registration takes precedence and it will be set as the token’s expiration time.
Once registered, you can’t change the expiration time of a token through the Manager’s edit screen. However, you can alter it by calling the API Manager (which is an API provided by Sensedia and hosted on your Manager).
To alter the expiration time, you need to make a PUT request to the endpoint <manager_url>/api-manager/api/v3/access-tokens/{code}
.
Among other information, the request contains the property expiresIn
, which expects the value in seconds of the expiration time in number format.
For more information, you can consult the API Manager’s Swagger through the Manager interface (by clicking on the icon next to your user name and then on API Manager Browser):
Share your suggestions with us!
Click here and then [+ Submit idea]