Access token doc (#1323) (#9490)

Doc for personal access tokens on Hub
This commit is contained in:
lena-larionova 2019-09-19 15:12:33 -07:00 committed by Adrian Plata
parent 4fa527705e
commit 687683427e
6 changed files with 66 additions and 5 deletions

View File

@ -3994,6 +3994,10 @@ manuals:
section:
- path: /docker-hub/
title: Quickstart
- sectiontitle: Security and Authentication
section:
- path: /docker-hub/access-tokens/
title: Managing Access Tokens
- path: /docker-hub/release-notes/
title: Release notes
- path: /docker-hub/repos/

View File

@ -0,0 +1,58 @@
---
title: Managing access tokens
description: Learn how to create and manage your personal Docker Hub access tokens to securely push and pull images programmatically.
keywords: docker hub, hub, security, PAT, personal access token
---
Docker Hub lets you create personal access tokens as alternatives to
your password. Access tokens are linked to a particular user account and
duplicate any permissions that account has. If the account changes
permissions, so will the token.
Access tokens are useful in cases such as building integrations since
you can issue multiple tokens – one for each integration –
and revoke them at any time.
## Create an access token
You can create as many tokens as you need.
1. Log in to [hub.docker.com](https://hub.docker.com).
2. Click on your username in the top right corner and select **Account
Settings**.
3. Select **Security > New Access Token**.
![](images/hub-create-token.png)
4. Add a description for your token. Use something that indicates where
the token is going to be used, or set a purpose for the token.
5. Copy the token that appears on the screen. Make sure you do this now:
once you close this prompt, Docker will never show the token again.
![](images/hub-copy-token.png)
Treat access tokens like your password and keep them secret. Store your tokens securely (for example, in a credential manager).
## Modify existing tokens
You can rename, deactivate, or delete a token as needed.
1. Access your tokens under **Account Settings > Security**.
2. Select a token and click **Delete** or **Edit**, or use the menu on
the far right of a token row to bring up the edit screen. You can also
select multiple tokens to delete them all once.
![](images/hub-edit-token.png)
## Use an access token
You can use an access token anywhere that requires your Docker Hub
password.
For example, when logging in from your Docker CLI client (`docker login --username <username>`), omit the password in the login command. When you're prompted for a password, enter your token instead.

Binary file not shown.

After

Width:  |  Height:  |  Size: 141 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 244 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 134 KiB

View File

@ -7,25 +7,25 @@ redirect_from:
- /datacenter/dtr/2.5/guides/user/access-tokens/
---
Docker Trusted Registry allows you to create and distribute access tokens to enable programmatic access to DTR. Access tokens are linked to a particular user account and duplicate whatever permissions that account has at time of use. If the account changes permissions, so will the token.
Docker Trusted Registry lets you create and distribute access tokens to enable programmatic access to DTR. Access tokens are linked to a particular user account and duplicate whatever permissions that account has at the time of use. If the account changes permissions, so will the token.
Access tokens are useful in cases such as building integrations since you can issue multiple tokens &ndash; one for each integration &ndash; and revoke them at any time.
## Create an access token
1. To create an access token for the first time, log in to `https://<dtr-url` with your UCP credentials.
1. To create an access token for the first time, log in to `https://<dtr-url>` with your UCP credentials.
2. Expand your **Profile** from the left navigation pane and select **Profile > Access Tokens**.
![Token list](../images/access-tokens-1.png){: .with-border}
3. Add a description for your token. Specify something which indicates where the token is going to be used, or set a purpose for the token. Administrators can also create tokens for other users.
3. Add a description for your token. Use something that indicates where the token is going to be used, or set a purpose for the token. Administrators can also create tokens for other users.
![Create token](../images/access-tokens-2.png){: .with-border}
## Modify an access token
Once the token is created, you will not be able to see it again. You do have the option to rename, deactivate or delete the token as needed. You can delete the token by selecting it and clicking **Delete**, or you can click **View Details**:
Once the token is created, you will not be able to see it again. You do have the option to rename, deactivate, or delete the token as needed. You can delete the token by selecting it and clicking **Delete**, or you can click **View Details**:
![Create token](../images/access-tokens-3.png){: .with-border}
@ -43,4 +43,3 @@ To use the DTR API to list the repositories your user has access to:
```bash
curl --silent --insecure --user <username>:<token> dtr.example.org/api/v0/repositories
```