Skip to content

Access Token Controller

A REST Controller for creating access tokens to be used as bearer authentication tokens for calling FlexNet Operations APIs (SOAP and REST). This REST web service also supports reading, updating, searching, rotating, and deleting tokens.

FlexNet Operations uses different token types to manage different access levels and operations:

  • NORMAL tokens can be requested by any FlexNet Operations user to authenticate themselves at a FlexNet Operations API.
  • IMPERSONATED tokens can be requested by a privileged user for use by other FlexNet Operations users.

To create and manage IMPERSONATED tokens, users require the Create Impersonated Token permission and a Manage Users permission.

Create an access token

Request

Use this API to create an access token.

The response includes the token value. This is the only time the token value is displayed. The value must be included as a Bearer token in the Authorization HTTP header for authorization requests.

Typically, an access token has the following attributes:

  • Token name—Must be unique and 5 - 25 characters long.
  • Expiry string—The token lifetime. Format: *y *M *d *h *m, where y=years, M=months, d=days, h=hours, m=minutes (case sensitive), and * representing any number.
  • Token type—Valid values: NORMAL | IMPERSONATED.
  • Token description—Mandatory for IMPERSONATED tokens.
  • Username—User name of the user on whose behalf the token is created. Mandatory for IMPERSONATED tokens.

When a username is provided for the creation of a NORMAL token, that username is ignored when calling an API. Instead, the user calling the API is authenticated.

Bodyapplication/jsonrequired

reqBody

expiryStrstringrequired

Lifetime of the token as specified when the token was created.
Format: *y *M *d *h *m, where y=years, M=months, d=days, h=hours, m=minutes (case sensitive), and * representing any number.

tokenDescriptionstring

Mandatory for IMPERSONATED tokens; optional for NORMAL tokens. For IMPERSONATED tokens, use this field to capture the impersonation reason.

tokenNamestringrequired

Name of the token, must be 5 - 25 characters long.
The following characters are not supported:
* < > + $ ? . ^ | % ] \\\\ (four consecutive back slashes are not allowed)
HTML tags that may indicate an XSS attack will be rejected.

tokenTypestringrequired

Specify the token type.
NORMAL tokens can be requested by any FlexNet Operations user.
IMPERSONATED tokens can be requested by a privileged user on behalf of another FlexNet Operations user.

Enum:"NORMAL""IMPERSONATED"
usernamestringrequired

The user for whom the token is created. Usually this is specified as an email address. This field is mandatory for IMPERSONATED tokens.

curl -i -X POST \
  'https://{siteID}.flexnetoperations.com/flexnet/uar/v1/token' \
  -H 'Content-Type: application/json' \
  -d '{
    "expiryStr": "string",
    "tokenDescription": "string",
    "tokenName": "string",
    "tokenType": "NORMAL",
    "username": "string"
  }'

Responses

OK

Bodyapplication/json
responseObjectobject(AccessTokenResponseWithTokenValue)
statusMessagestring

The status message related to this API request.

Response
{ "responseObject": { "expiryStr": "string", "tokenDescription": "string", "tokenExpiryMillis": 0, "tokenIssueMillis": 0, "tokenName": "string", "tokenCreator": "string", "tokenType": "NORMAL", "tokenValue": "string", "username": "string" }, "statusMessage": "string" }