Skip to main content
Skip table of contents

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.

CODE
GET - /data/services/tokens/issue

Parameters: None


Response: Returns an alias token object for the logged-in user account

CODE
{
  "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.

CODE
GET - /data/services/tokens/issue/user/{username}

Parameters:

{username}

Required path parameter. Enter a valid username

Response:

CODE
{
  "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

CODE
GET - /data/services/tokens/validate/{token}/{secret}

Parameters:

{token}

Required path parameter

{secret}

Required path parameter

Response:

If token is valid
CODE
{"valid":"username"}
If token is invalid
CODE
{}

Invalidate A User Alias Token

CODE
GET - /data/services/tokens/invalidate/{token}/{secret}

Parameters:

{token}

Required path parameter

{secret}

Required path parameter

Response: None

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.