# Manage login tokens

List the registry login tokens you created and revoke one, for example after it leaked.

You see and revoke only your own tokens, never another user's, and never a token's value: it is
shown once, when it is created. Replace token-id with the token's id.

## Prerequisites

- Permission for `ecr:GetAuthorizationToken`. Without it the console's **Access** page shows a
  refusal.

## Revoke a token

**Console**
1. Open **Container registry**, then choose **Access**.
2. Under **Login tokens**, find the token by **Created** and **Works until**.
3. Choose its delete icon (**Revoke**), then choose **Revoke**.

The **Push commands** tab of a repository lists the same tokens under **Your active tokens**, each
with **Revoke**; there it revokes at once, without a confirmation.

**CLI**
```sh
dcloud ecr auth list-login-tokens
dcloud ecr auth revoke-login-token token-id
```

**API**
```http
DELETE /ecr/api/login-tokens/token-id
```

`GET /ecr/api/login-tokens` lists your live tokens: `id`, `createdAt`, `expiresAt`.

## Result

From then on the registry refuses the token at `docker login` and at every exchange for a registry
token. A registry token docker already received with it works until it expires, at most one hour.
`404` `Not found` answers an id that is not one of your own tokens, or a token already revoked.

## Related

- [Log in to the registry](log-in.md)
- `ecr.auth.revoke-login-token` · `dcloud ecr auth revoke-login-token`
