Extend Authentication Token

Title

Extend expiry date for an authentication token

URL Path

vault_rest/token

Method

PUT

CORS support

Yes

Http return

200, 400, 401, 403, 500

Table of Contents

Last Updated

30 Aug 2018

Summary

This API allows a user to extend an authentication token.

Use Cases (used by)

Used by clients that want to prevent an authentication token expiry due to inactivity or change the expiration of an existing generated API token.

HTTP header parameters

Name

Value

Required

Description

Example

Authorization

The authentication token of the caller

REQUIRED

This header should have the following format:
Bearer [token obtained from authenticate API]
Example: Bearer Cp01BwnXAIOLZXxn7yogjKqIZnZpQD

PUT /vault_rest/token HTTP/1.1
Host: localhost:8000
Authorization: Bearer rWx0PkJHv2G8C5FvvYCEqpj89SDct0
Token: RHjO1SH9GqjBAbGxFOh2jqI9HjNAJD
ExtendBy: 01:00:00

Token

The token to be extended

REQUIRED*

The token that you wish to extend.
*Note: If this header is not present the token from Authorization header will be used instead

ExtendBy

Request to extend the token

OPTIONAL

Parameter value must be a time span (hh:mm:ss) value how long to extend the authentication token expiry.
If this parameter is not specified a default server value is used.
Max value is 24h: 23:59:59

ExtendUntil

Request to extend the token until a specific date

OPTIONAL

Used to adjust 3rd party authentication token's expiry date.
Date should be specified in UTC, for example: 2016-01-02T12:00:00.0000000Z

Request Error

400

Bad Request

Invalid HTTP request

401

Invalid parameter

One or more parameters are invalid

403

Forbidden

Authentication token is incorrect

500

Internal Server Error

Server is temporarily unavailable

Response

Example of a successful request:

{
"expires": "2017-05-09T13:31:44.7587334Z",
"token": "f3I8Vss3cWAuh3EscB06QRDcQfMzHY",
"user_id": 1
}

Descriptions of response:

token

Authentication token extended

The token that was extended

expires

Date and time of token expiry

The token is guaranteed to be valid until this date and time, even if no subsequent calls are made (except when token is canceled by Cancel Authentication token)

user_id

The id of the user associated with the token

Database id of the user associated with the token