UserLoginTokens

Introduction

UserLoginTokens are short-lived, user-specific tokens that allow a browser to log in a User without entering credentials. They are typically used for auto-login URLs or SSO-like flows where an application needs to sign in a User in a standard web context.

User login tokens are intended for one-time use: when a token is used during a login, it is soft deleted so it cannot be reused. Tokens are also invalid after their configured expiration time.

For usage examples see the Login By User Login Token section.

The actual login token (the secret the browser uses to perform the login) is only returned in the response payload of the create action. It is provided under the key token in the JSON response and is not present on list or show responses. Store or forward this token securely immediately after creation because it will not be retrievable later.

Model Definition

Relations

Key
Relation
Type
Relation Field(s)

user

Belongs to

user_id

loginUser

Belongs to

login_user_id

Traits

  • SoftDeletes

[Adm.] List

Get a list of all UserLoginTokens.

Definition

GET /api/administration/users/login-tokens

Example Request

Example Response

[Adm.] Show

Show a single UserLoginToken by uuid.

Definition

GET /api/administration/users/login-tokens/{uuid}

Example Request

Example Response

[Adm.] Create

Create a new UserLoginToken for a User.

Definition

POST /api/administration/users/login-tokens

Request Keys

Key
Type
Default
Description

login_user_id *

integer

-

The ID of the User to login.

expires_in *

integer

-

The amount of seconds until the login token expires (between 1 and 86400 (24 hours)).

Keys with * are required.

Example Request

Example Response

The actual login token is provided under the key token in the JSON response. Store this token securely immediately after creation because it will not be retrievable later.

[Adm.] Create By Email

Create a new UserLoginToken for a User's email.

Definition

POST /api/administration/users/login-tokens/email

Request Keys

Key
Type
Default
Description

login_user_email *

string

-

The email of the User to login.

expires_in *

integer

-

The amount of seconds until the login token expires (between 1 and 86400 (24 hours)).

Keys with * are required.

Example Request

Example Response

The actual login token is provided under the key token in the JSON response. Store this token securely immediately after creation because it will not be retrievable later.

[Adm.] Delete

Delete a UserLoginToken by uuid.

Definition

DELETE /api/administration/users/login-tokens/{uuid}

Example Request

Example Response

Last updated