---
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 a Access Token

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

* Token Name: Unique identifier for the token
* Expiration Time: Token expiry time; the token becomes unusable after expiration
* Scope of Use: Repository types the token can access
* Authorization Scope: Operational permissions granted to the token under the account
* Common Scenarios: Quick initialization of authorization scope based on common usage scenarios

## Token Usage Scenarios

**Accessing Code Repositories:**

* Username: `cnb`
* Password: The added access token

**Accessing Artifact Repositories:**

* Username: `cnb`
* Password: The added access token

### 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).
