# Create Access Token

For the JFrog Connect API v2, there are two types of access tokens, User (also called [identity tokens](https://jfrog.com/help/r/platform-api-key-deprecation-and-the-new-reference-tokens/so-why-did-jfrog-deprecate-api-keys)) and Custom (also called scoped tokens). This increases the system security by enabling you to construct an access token that is very specific to the permissions allowed.

The tokens you create in Connect are valid only in Connect. However, if you create an admin token in Artifactory, you can use it in the Connect API v2.&#x20;

{% hint style="success" %}
**Important**: Use this page only if you have the old web UI. If you have the new UI, use [Create Access Token - New UI](https://docs.connect.jfrog.io/developers/api-reference/create-access-token-1).
{% endhint %}

### Access Tokens Tab

In the Connect Settings, the Access Tokens tab shows a listing and brief description of the access tokens created in your account.

<figure><img src="https://content.gitbook.com/content/RPSTjDOh8m1HIptqGtC4/blobs/uC471v1urfJETU0ZOLZ5/access-token-01a.png" alt=""><figcaption></figcaption></figure>

The Access Tokens table includes the following information in the columns:

* **Description**: One or more words indicating what the token is for.
* **Subject**: The user for whom the token was created.
* **Token ID**: The UUID of the token.
* **Issued Date**: The date and time the token was created.
* **Expiry Date**: The date and time the token will expire.
* **Scope**: An indication of the permissions allowed by the token.

To revoke a token, click the three dots at the end of the relevant row and click Revoke.

<div align="left"><figure><img src="https://content.gitbook.com/content/RPSTjDOh8m1HIptqGtC4/blobs/Q8bO9nF8sbjoFWP869Xv/access-token-01-1.png" alt="" width="375"><figcaption></figcaption></figure></div>

### Token Scopes

You can create the following types of access tokens:

* **User**: Also called an *identity token* or a *user-scoped token*. This token provides access according to the permissions defined for the user in the User Permissions page. This kind of token can be created in Connect or in the JFrog Platform.
* **Custom**: These tokens, also known as *scoped tokens*, have permissions that are customized for a specific purpose. For example, the token allows access by any Connect user, but allows access to certain resources (e.g., a device or a project) and functions (e.g., read or write) only, and not to others. These tokens can be created only in Connect and only by an [administrator](https://docs.connect.jfrog.io/administration/settings/user-management) user.

## Create User Token

To create a new token, do the following:

1. Go to Settings in the left navigation bar and click the **Access Tokens** tab.
2. In the Access tokens tab, click the **+** on the upper right and enter a **Description** and **Expiration Date** for the new token.
3. Under Token Scope, choose **User** and select the user from the dropdown list.
4. Generate the token.

## Create Custom (Device-Scoped) Token

To create a new token, do the following:

1. Go to Settings in the left navigation bar and click the **Access Tokens** tab.
2. In the Access tokens tab, click the **+** on the upper right and enter a **Description** and **Expiration Date** for the new token.
3. Under Token Scope, choose **Custom** and choose a **Permissions Action Type**. (Device is currently the only option.) Permissions Action Type enables access to a certain feature or set of features in Connect, such as device metadata.

<div align="left"><figure><img src="https://1862246491-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FRPSTjDOh8m1HIptqGtC4%2Fuploads%2FURCdyTZsmClwL9lt1cFE%2Fcreate-access-token-03a.png?alt=media&#x26;token=8213e626-a60d-4a09-8564-e98f757b6b79" alt="" width="375"><figcaption></figcaption></figure></div>

4. Choose the **Target Entity** and the **Permission Type** from the respective lists. The target entity can be either Project or Device.

<div align="left"><figure><img src="https://content.gitbook.com/content/RPSTjDOh8m1HIptqGtC4/blobs/YNTlgdOmiAiqzCNLuQQb/access-token-01-4.png" alt="" width="375"><figcaption></figcaption></figure></div>

5. Click **Add**. The permission will be added to the table in the lower part of the page. You may create multiple permissions for the token, and each permission will appear as a row in the table. Once you have created all the necessary permissions, generate the token.

<div align="left"><figure><img src="https://content.gitbook.com/content/RPSTjDOh8m1HIptqGtC4/blobs/oKlYFIuvWN4XKXGTMwGT/access-token-01-5.png" alt="" width="563"><figcaption></figcaption></figure></div>

## Generated Token

After you generate the new access token, it will be displayed.&#x20;

{% hint style="info" %}
**Important**:&#x20;

* For security reasons, the new token generated will not be stored. Ensure that you copy the token and keep it in a safe place. Once you close the token display window, it will not be available again.
* Do not expose the token in your API request tool. It is highly recommended to use an API tool that handles the token securely (for example, it uses a variable for your token), and not to expose the token directly.
  {% endhint %}

## What’s Next?

Learn about the [Connect API v2](https://docs.connect.jfrog.io/developers/api-reference/connect-api-reference) and the details of all the API requests you can use.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.connect.jfrog.io/developers/api-reference/create-access-token.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
