Obtain tokens

更新时间:
复制 MD 格式

If you access a code repository over the HTTPS protocol, you must obtain the token that is used to access the code repository before you add code access permissions. This topic describes how to obtain a token that is used to access GitLab. The operations that are performed to obtain the tokens that are used to access other code repositories such as AliyunCode and GitHub are similar to the operations that are performed in this topic.

Prerequisites

Procedure

  1. Click the profile picture in the upper-right corner of the GitLab home page and select Edit profile from the menu. The User Settings page appears.Entry point for the personal information page

  2. In the left-side navigation pane of the User Settings page, click Access Tokens.

    Access Token

  3. On the Access Tokens page, configure the parameters. The following table describes the parameters.

    Parameter

    Description

    Token name

    The name of the token.

    Expiration date

    The expiration date of the token.

    Select scopes

    The permission levels that are granted to the token. You can select read_repository or write_repository.

    Note

    To use EMAS Cloud Building, you must at least obtain the permissions to read a code repository.

  4. Click Create personal access token to generate a token.

    token

    Important

    • After the token is generated, you must immediately copy and save the token. After you leave the page, you can no longer view the information of the token.

    • A token is sensitive information. Keep it confidential.