User Alias Token API
This service creates a user alias token that allows an external application to perform actions within your XNAT as a valid logged-in user. This service should be used with caution.
Issue A New User Alias Token
This REST service creates a new user alias token for the currently logged-in user. By default, this token will be valid for 48 hours after it is created, unless it is invalidated.
GET - /data/services/tokens/issue
Parameters: None
Response: Returns an alias token object for the logged-in user account
{
"alias": "string",
"xdatUserId": "string",
"secret": "string",
"singleUse": boolean,
"estimatedExpirationTime": timestamp,
"timestamp": timestamp,
"enabled": boolean,
"created": timestamp,
"id": integer,
"disabled": integer
}
Issue A New User Alias Token For Another User
This REST service creates a new user alias token for a different user. This endpoint can only be used by users with site admin access.
GET - /data/services/tokens/issue/user/{username}
Parameters:
{username} | Required path parameter. Enter a valid username |
---|
Response:
{
"alias": "string",
"xdatUserId": "string",
"secret": "string",
"singleUse": boolean,
"estimatedExpirationTime": timestamp,
"timestamp": timestamp,
"enabled": boolean,
"created": timestamp,
"id": integer,
"disabled": integer
}
Validate A User Alias Token
GET - /data/services/tokens/validate/{token}/{secret}
Parameters:
{token} | Required path parameter |
---|---|
{secret} | Required path parameter |
Response:
If token is valid
{"valid":"username"}
If token is invalid
{}
Invalidate A User Alias Token
GET - /data/services/tokens/invalidate/{token}/{secret}
Parameters:
{token} | Required path parameter |
---|---|
{secret} | Required path parameter |
Response: None