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