Summary:
List available access tokens, and create new access tokens. Applicable to Entuity v21.0 P02 upwards.
URL:
http(s)://{server hostname}/api/accessTokens
Methods summary
- GET Method - lists available access tokens.
- POST Method - creates new access tokens.
GET Method detail
Lists available access tokens.
Response:
Name | Description |
---|---|
tokenId | ID of the token. |
tokenValue | value of the token. |
userId | ID of the user account by which the token is authenticated, i.e. if specified as 'User 1', then the token session will provide access based on User 1's privileges. |
expiryTimeSec | timestamp of when this token will expire, in seconds. |
creationTimeSec | timestamp of when this token was created, in seconds. |
createdBy | user account that created this token. Note, if access keys have been previously created in the accessKeys.properties file for SAMLv2 purposes, which are not done by any particular user, you might see <system> in this column. |
lastUpdateTimeSec | timestamp of when this token was last edited, in seconds. |
lastUpdatedBy | user account that last edited the token. |
description | description of this access token, if specified. |
userName | user account by which the token is authenticated, i.e. if specified as 'User 1', then the token session will provide access based on User 1's privileges. |
activeSessionCount | number of current active sessions using this token. |
lastLoginTimeSec | timestamp of when this token was last used to access Entuity, in seconds. |
loginCount | number of times this token has been used to access Entuity. |
Example:
INPUT
curl -u admin:admin https://localhost/api/accessTokens?media=json
OUTPUT
{
"items" : [ {
"tokenId" : 10 ,
"tokenValue" : "another123" ,
"userId" : 6 ,
"expiryTimeSec" : 0 ,
"creationTimeSec" : 1682686267 ,
"createdBy" : "kim1" ,
"lastUpdateTimeSec" : 1682686267 ,
"lastUpdatedBy" : "kim1" ,
"description" : "access token for guy1 expiring Tue Apr 25 11:20:00 2023" ,
"userName" : "kim1" ,
"activeSessionCount" : 0 ,
"stats" : {
"lastLoginTimeSec" : 1682692019 ,
"loginCount" : 1
}
}, {
"tokenId" : 11 ,
"tokenValue" : "notsecure123" ,
"userId" : 3 ,
"expiryTimeSec" : 0 ,
"creationTimeSec" : 1682686267 ,
"createdBy" : "<system>" ,
"lastUpdateTimeSec" : 1682686267 ,
"lastUpdatedBy" : "<system>" ,
"description" : "Migrated API access key" ,
"userName" : "admin" ,
"activeSessionCount" : 0 ,
"stats" : {
"lastLoginTimeSec" : 0 ,
"loginCount" : 0
}
} ],
"count" : 2
}
POST Method detail
Creates a new access token.
Request:
Name | Description |
---|---|
userName | user account by which the token is authenticated, i.e. if specified as 'User 1', then the token session will provide access based on User 1's privileges. |
expiryTimeSec | timestamp of when this token will expire, in seconds. |
description | description of this access token. |
Response:
Name | Description |
---|---|
tokenId | ID of the token. |
tokenValue | value of the token. |
userId | ID of the user account by which the token is authenticated, i.e. if specified as 'User 1', then the token session will provide access based on User 1's privileges. |
expiryTimeSec | timestamp of when this token will expire, in seconds. |
creationTimeSec | timestamp of when this token was created, in seconds. |
createdBy | user account that created this token. Note, if access keys have been previously created in the accessKeys.properties file for SAMLv2 purposes, which are not done by any particular user, you might see <system> in this column. |
lastUpdateTimeSec | timestamp of when this token was last edited, in seconds. |
lastUpdatedBy | user account that last edited the token. |
description | description of this access token, if specified. |
Example:
INPUT
curl -u admin:admin https://localhost/api/accessTokens?media=json -X POST -H "content-type:application/json" -d \
{
"userName" : "guy2",
"expiryTimeSec" : 1682418245,
"description" : "Token for guy2 expiring Tue Apr 25 11:24:05 2023"
}'
OUTPUT
{
"tokenId" : 17 ,
"tokenValue" : "WlT6a0I6gGAc6V6h0XqM/L2PUVzUQ63H" ,
"userId" : 10 ,
"expiryTimeSec" : 1682418245 ,
"creationTimeSec" : 1683033889 ,
"createdBy" : "admin" ,
"lastUpdateTimeSec" : 1683033889 ,
"lastUpdatedBy" : "admin" ,
"description" : "Token for guy2 expiring Tue Apr 25 11:24:05 2023"
}
Comments
0 comments
Please sign in to leave a comment.