---
url: /en/guide/access-token.md
description: >
  Explains how to create and manage access tokens on the CNB platform for
  authenticating access to code repositories, artifact repositories, and the
  OpenAPI.
---
All resources on the Cloud Native Build Platform
(code repositories, artifact repositories, OpenAPI, etc.) require authentication via access tokens.

## Creating an Access Token

After logging in, navigate to
`Personal Settings` → [Access Token](//cnbprod.alpha.qq.com/profile/token)
→ `Add Access Token`, and configure the following parameters:

* **Token Name**: Unique identifier
* **Expiration Time**: Token becomes unusable after expiration
* **Scope of Use**: Repository types the token can access
* **Authorization Scope**: Operational permissions
* **Common Scenarios**: Quick initialization of authorization scope based on usage scenarios

:::: tip Default Permissions
After creation, access tokens have read-only permissions on **public** organizations/repositories/
registries/missions by default, **no permissions** on private repositories and registries, and
**no permissions** on account-related operations by default.
To access private resources, explicitly select the corresponding authorization scopes.
::::

## Usage

**Accessing code repositories** and **accessing artifact repositories**: Username `cnb`, password is the access token.

For example, to clone a repository, enter `cnb` as the username and your
access token as the password when prompted:

```bash
# Clone a private repository, then enter your username and password when prompted
git clone https://cnbprod.alpha.qq.com/group-path/repo-path
```

### Accessing OpenAPI

Refer to: [Open API](../develops/openapi.md)

## CI Temporary Tokens

Pipelines embed temporary tokens
(automatically destroyed at the end of the pipeline),
obtainable through the environment variable
[CNB\_TOKEN](../build/build-in-env.md#CNB_TOKEN).
