# auth.generate_token

Generate a token to be used for authentication.

ttl stands for Time To Live, in seconds. The token will be invalidated if the connection has been inactive for a time greater than this.

attrs is a general purpose object/dictionary to hold information about the token.

match_origin will only allow using this token from the same IP address or with the same user UID.

NOTE: this endpoint is not supported when server security requires replay-resistant authentication as part of GPOS STIG requirements.

Type: object

##

Type: array
No Additional Items

#### Tuple Validation

##### Parameter 1: ttl

#### ttl

Default: 600

Time-to-live for the token in seconds or `null` for no expiration (default 600).

## Any of

Type: integer
Type: null

##### Parameter 2: attrs

#### attrs

Type: object Default: {}

Additional attributes to embed in the token.

##### Parameter 3: match_origin

#### match_origin

Type: boolean Default: true

Whether the token must be used from the same origin that created it.

##### Parameter 4: single_use

#### single_use

Type: boolean Default: false

Whether the token can only be used once.

##

#### Result

Type: string

Generated authentication token.

Required roles: