Access Tokens
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 a personal credential token generated in CodeArts Repo. It can read and write repositories through HTTPS.
Generating an Access Token
Tokens are used to read from and write into repositories. Max. 20; max. validity: 1 year.
- 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.
- 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.
- Click Save. The token is generated.
- 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
- 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.
- Click Clone/Download, click Clone with HTTPS, and copy the HTTPS address.
- 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. The username is private-token, and the password is the generated token.
Figure 1 Entering the token username.
Figure 2 Entering the token password.
- Click OK. The repository is cloned and downloaded.
CodeArts Repo supports embedding the access token into the HTTPS download link. The embedding format is as follows:
https://username:password@codehub.xxx.com/{project_name}/{repository_name}.git
- username: private-token.
- password: the generated token.
- {project_name}: a project name.
- {repository_name}: a repository name.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot