Fetch a JWT token for authenticated user.
post
/tokens
Returns a JWT token for self.
Request
There are no request parameters for this operation.
Security
-
basicAuth: basic
Type:
basic
Response
Supported Media Types
- application/json
200 Response
OK
Root Schema : token-response
Type:
Show Source
object
-
accessToken:
string
JWT token string.
-
expiresIn:
string
Time after which the token gets expired.
-
tokenType:
string
Type of token. Its value is Bearer.
Examples
The following example returns a JWT token for authenticated user.
cURL Example
curl -I -X POST -u username:password -H "Accept: application/json" -H "Content-Type: application/json" -H "X-Requested-By: <anyvalue>" "https://pseudo.com/iam/governance/token/api/v1/tokens"
Example of Response Body
The following example shows the contents of the response body in JSON format:
{ "expiresIn": "1799", "tokenType": "Bearer", "accessToken": "eyJ4NXQiOiJvd2YzU0hsTnNob25sM2lZOXUtUnQtZjRETGciLCJraWQiOiJ4ZWxsIiwidHlwIjoiSldUIiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiJ4ZWxzeXNhZG0iLCJpc3MiOiJ3d3cub3JhY2xlLmNvbSIsImV4cCI6MTQ4MjM5NDIwNSwicHJuIjoieGVsc3lzYWRtIiwiaWF0IjoxNDgyMzkyNDA1fQ.bckyK9TSICdY4kqi2DpYy8rLzntrynPTOgj4XZRxN2CRpwdS_Vss9lS_BWk9Dz3GgZOEroAvUYTdP7Wh-ulqN23Xn0ez3ZPY3s6icCSBqK3Lw_kXoSm4NQL7UGzsF_tAsarLFQWn5xpORVmWRMxHTXycI14cVC_ZPNxubfsK6ec" }