Getting started#

The conda-auth plugin improves the authentication experience for conda. Read below to learn how to start using it.

Installation#

The plugin is available on conda-forge and can be installed like any other conda package:

conda install -c conda-forge conda-auth

Usage#

Once installed the plugin makes two new commands available: conda auth login and conda auth logout. The plugin supports various types of authentication schemes. Read below to learn how to use each.

HTTP basic authentication#

To log in to a channel using HTTP basic authentication, run the following command:

conda auth login <channel_name> --basic

Once this has been run, you will be prompted for your username and password.

For non-interactive automation, you can also specify username and password as command options:

conda auth login <channel_name> --basic --username "$USERNAME" --password "$PASSWORD"

Caution

Passing passwords directly on the command line may expose them in shell history or process listings. Prefer the prompt-based command when working interactively.

Token authentication#

The following examples are for authenticating with channels using token based authentication.

For anaconda.org channels:

conda auth login <channel_name> --token

You will then be prompted for your token. Optionally, you can specify the token value as an option for non-interactive automation:

conda auth login <channel_name> --token <token_value>

Caution

Passing tokens directly on the command line may expose them in shell history or process listings. Prefer the prompt-based command when working interactively.

For other channels not hosted at anaconda.org, use the full URL of the channel:

conda auth login https://example.com/my-protected-channel --token

Logging out of a channel#

If you want to clear your user credentials from your computer for any reason, you can do so by running the conda auth logout command. All you have to do is provide a channel name, and it will find and remove your credentials from the password store and user conda configuration.

You can do this by running the following command:

conda auth logout <channel_name>

Both login and logout support JSON output for automation:

conda auth login <channel_name> --token --json
conda auth logout <channel_name> --json

Storage backend unavailable?#

Conda auth relies on the keyring package to store its passwords and secrets. Because of this, it only supports a limited number of operating systems, mostly desktop operating systems like Windows, OSX and several Linux variants.

If you want to use conda-auth, but are not using a supported operating system, you can install the keyring-alt package:

conda install -c conda-forge keyrings.alt

Caution

This method stores passwords and secrets in a plain text file on the filesystem and may not be acceptable for production usage. Please read the project’s README for more information.

Reporting bugs#

Have you found a bug you want to let us know about? Please create an issue at our GitHub project.

And thank you for helping us improve conda auth!