2d4258
% containers-auth.json(5)
2d4258
2d4258
# NAME
2d4258
containers-auth.json - syntax for the registry authentication file
2d4258
2d4258
# DESCRIPTION
2d4258
14f7ae
A credentials file in JSON format used to authenticate against container image registries.
379816
The primary (read/write) file is stored at `${XDG_RUNTIME_DIR}/containers/auth.json` on Linux;
379816
on Windows and macOS, at `$HOME/.config/containers/auth.json`.
379816
379816
When searching for the credential for a registry, the following files will be read in sequence until the valid credential is found:
379816
first reading the primary (read/write) file, or the explicit override using an option of the calling application.
379816
If credentials are not present, search in `${XDG\_CONFIG\_HOME}/containers/auth.json`, `$HOME/.docker/config.json`, `$HOME/.dockercfg`.
379816
379816
Except the primary (read/write) file, other files are read-only, unless the user use an option of the calling application explicitly points at it as an override.
379816
2d4258
2d4258
## FORMAT
2d4258
2d4258
The auth.json file stores encrypted authentication information for the
2d4258
user to container image registries.  The file can have zero to many entries and
14f7ae
is created by a `login` command from a container tool such as `podman login`,
14f7ae
`buildah login` or `skopeo login`.  Each entry includes the name of the registry and then an auth
2d4258
token in the form of a base64 encoded string from the concatenation of the
2d4258
username, a colon, and the password.
2d4258
2d4258
The following example shows the values found in auth.json after the user logged in to
2d4258
their accounts on quay.io and docker.io:
2d4258
2d4258
```
2d4258
{
2d4258
	"auths": {
2d4258
		"docker.io": {
2d4258
			"auth": "erfi7sYi89234xJUqaqxgmzcnQ2rRFWM5aJX0EC="
2d4258
		},
2d4258
		"quay.io": {
2d4258
			"auth": "juQAqGmz5eR1ipzx8Evn6KGdw8fEa1w5MWczmgY="
2d4258
		}
2d4258
	}
2d4258
}
2d4258
```
2d4258
2d4258
An entry can be removed by using a `logout` command from a container
2d4258
tool such as `podman logout` or `buildah logout`.
2d4258
14f7ae
In addition, credential helpers can be configured for specific registries and the credentials-helper
14f7ae
software can be used to manage the credentials in a more secure way than depending on the base64 encoded authentication
14f7ae
provided by `login`.  If the credential helpers are configured for specific registries, the base64 encoded authentication will not be used
14f7ae
for operations concerning credentials of the specified registries.
14f7ae
14f7ae
When the credential helper is in use on a Linux platform, the auth.json file would contain keys that specify the registry domain, and values that specify the suffix of the program to use (i.e. everything after docker-credential-).  For example:
14f7ae
14f7ae
```
14f7ae
{
14f7ae
    "auths": {
14f7ae
        "localhost:5001": {}
14f7ae
    },
14f7ae
    "credHelpers": {
14f7ae
		"registry.example.com": "secretservice"
14f7ae
	}
14f7ae
}
14f7ae
```
14f7ae
14f7ae
For more information on credential helpers, please reference the [GitHub docker-credential-helpers project](https://github.com/docker/docker-credential-helpers/releases).
14f7ae
2d4258
# SEE ALSO
14f7ae
    buildah-login(1), buildah-logout(1), podman-login(1), podman-logout(1), skopeo-login(1), skopeo-logout(1)
2d4258
2d4258
# HISTORY
2d4258
Feb 2020, Originally compiled by Tom Sweeney <tsweeney@redhat.com>