Updated on 2023-12-06 GMT+08:00

Access Token

Introduction

When a third-party application calls an API, CodeArts Repo verifies the application's identity and permissions. An access token is used to authenticate the third-party application that calls the API.

An access token is your personal credential generated in CodeArts Repo. It is used to read and write APIs or clone and download repositories in CodeArts Repo.

Generating an Access Token

Tokens are used to read from and write into repositories. Max. 20; max. validity: 1 year.

  1. Log in to the repository list page of CodeArts Repo, click the alias in the upper right corner, and choose This Account Settings > Repo > Access Token.
  2. On the Access Tokens page, click New Token and enter basic information according to the following table.

    Table 1 Parameter description

    Parameter

    Description

    Token Name

    This parameter can be customized to distinguish it from other tokens. Max. 200 characters.

    Description

    The description can be empty. Max. 200 characters. If the description is empty, "--" is displayed in the list.

    Permission

    Read/Write API: Read from and write into repositories using HTTPS.

    Created

    Time when the token is successfully created. The time format is MMM DD, YYYY.

    Expired

    Time when the token expires. The default value is 30 days later than the current date, including the current day. For example, if a token is created on October 8, the default expiration date is 23:59:59 on November 6. The maximum validity period is one year, and this parameter cannot be empty. The time format is MMM DD, YYYY.

    Operation

    You can delete a token.

  3. Click Save. The token is generated.
  4. Click Copy to save the token to the local host.

    Save the token securely once it is generated, since it is displayed only once and cannot be viewed later. If you lose or forget it, regenerate one.

Using an Access Token

  1. Go to CodeArts Repo and run the git clone command to download a repository to the local host. By cloning a repository, you can download a backup of its files to the local host and retain a Git connection to the remote repository.
  2. Click Clone/Download, click Clone with HTTPS, and copy the HTTPS address.
  3. Open the Git Bash client, go to your directory, and run the following command to clone the repository:

    git clone HTTPS_download_address

    In the displayed dialog box, enter the token username and password.

    Figure 1 Entering the token username.
    Figure 2 Entering the token password.

    The token username is private-token, and the token password is the generated token.

  4. Click OK. The repository is cloned and downloaded.