Skip to main content

Generating Personal Access Tokens

Personal access tokens provide authenticated access to GitLab CE. They are an alternative to OAuth2 tokens and are similar to group access tokens and project access tokens, but are attached to a user rather than a group or project.

You can use a personal access token to authenticate with the GitLab API, With Git over HTTPS, etc.

note

You must authenticate with a personal access token if two-factor authentication (2FA) or SAML is enabled.

To do so, go to Access Tokens in your GitLab preferences, then tap "Add new token".

We recommend to only grant the neccessary personal access token scopes for the token. As an example:

Token Generation

Optionally, you can enter a description for the token and enter an expiry date for the token. The token expires at midnight UTC on that date, and if you do not enter a date, the expiry date is set to 365 days from the day generated.

Select Generate token.

A personal access token is displayed. Save the personal access token somewhere safe. After you leave or refresh the page, you cannot view it again.