========
Accounts
========

All Anaconda.org users can find, download, and use packages without having an Anaconda.org account. *This means packages you upload to your Anaconda.org account are accessible to everyone.* However, you need to create an Anaconda.org account in order to do the following:

* Author packages
* Upload packages
* Access shared, private packages
* Create organizations

.. _cloud-accounts-create:

Creating a free account
=======================

Follow these steps to sign up for a free Anaconda.org account:

#. In a browser, go to `Anaconda.org <http://anaconda.org>`_.
#. Make sure the **Sign Up** tab is active.
#. Enter a username.
#. Enter your email address.

   .. note::
      
      Users who register with an .edu email are granted some additional features.

#. Create a password.

   .. note::
      
      The password must be at least seven characters long.

#. Enter the password again to confirm it.
#. Read and accept the Terms and Conditions.
#. Confirm you are not a robot. 
#. Click **Register For Free**.
#. Verify your account from the email sent to you.
#. Log in to your free account and view your personal dashboard.

.. tip::

   Anaconda.org displays your profile photo if the email address you used to register on Anaconda.org is associated with a Gravatar account. To associate your email address or change your Gravatar profile photo, go to `gravatar.com <http://gravatar.com>`_.

Navigating your home page
=========================

When you are logged in to Anaconda.org, your profile name appears in the top-right corner of every page. This indicates the name of the currently active user or organization.

Use the **View** dropdown menu to access the following pages:

* **Landscape** - This is your home page, where packages that you have created appear
* **Favorites** - This page contains packages from other users you have starred
* **Packages** - This page only contains packages you have created

Resetting your password
=======================

Follow these steps to reset your password:

#. Log in to Anaconda.org.
#. From your profile in the top-right corner, select **Settings**.
#. Click **My Account** in the left-hand menu. Verify your password if prompted.
#. In the **Change Password** section, enter your old password, then enter and confirm a new password.
#. Click **Change Password**.

.. _cloud-accounts-upgrade-plan:

Upgrading or downgrading your plan
==================================

If you require more private packages or storage space than is included in a personal plan, `contact Anaconda <https://www.anaconda.com/contact>`_ so we can customize a plan for you.

.. _cloud-accounts-tokens:

Creating access tokens
======================

The best way to manage access or make packages private is to create :ref:`organizations <creating-orgs>` or :ref:`groups <org-groups>`, which allow you to set separate permissions per package.

You can also control access with the :ref:`glossary-token` system. You can use tokens to control access to private repositories, collections, or packages on Anaconda.org. Additionally, the degree of access a token grants is completely configurable at the time of generation. You can generate multiple tokens to control which groups of users have access to certain features if they have the appropriate token.

.. _cloud-accounts-generate:

Generating tokens
-----------------

Tokens provide varying degrees of access to content within a specified channel depending on the scope assignment. If you need to separate permission levels by package, you can create an :ref:`organization <creating-orgs>` and :ref:`groups <org-groups>` within that organization.

.. note::

   By default, tokens expire after one year.
               
.. tab-set::

    .. tab-item:: CLI

        #. Open Anaconda Prompt (Terminal on macOS/Linux) and run the following command::

               # Replace <YOUR_TOKEN_NAME> with a name of your choosing
               # Replace <SCOPE> with a scope(s) from the Scopes dropdown below
               anaconda auth --create --name <YOUR_TOKEN_NAME> --scopes '<SCOPE1> <SCOPE2>'   

           This generates a random alphanumeric string. That string is your token! You can distribute your token to other Anaconda.org users to provide them with a specific, limited set of permissions to interact with your Anaconda.org assets.

        #. Add the token to your channel path in your .condarc file by running the following command::

            # Replace <TOKEN> with your token string
            # Replace <CHANNEL> with the channel name
            conda config --add channels https://conda.anaconda.org/t/<TOKEN>/<CHANNEL>

           Or, add a channel with a token and a label::

             # Replace <TOKEN> with your token string
             # Replace <CHANNEL> with the channel name
             # Replace <YOUR_TOKEN_NAME> with the label name used in the previous step
             conda config --add channels https://conda.anaconda.org/t/<TOKEN>/<CHANNEL>/label/<YOUR_TOKEN_NAME>

         .. dropdown:: Scopes
             :animate: fade-in
             :color: primary

             Assign scopes to tokens to set permission levels for token holders. Scopes are provided as a space-separated, quoted list. 

             Available scopes:

               .. csv-table:: 
                  :file: ../../csv/scopes.csv
                  :widths: 45, 45
                  :header-rows: 1

    .. tab-item:: Anaconda.org

        #. Log in to Anaconda.org.
        #. From your profile in the top-right corner, select **Settings**.
        #. Click **Access** in the left-hand menu. 
        #. Fill out the Create access token form:

           #. Provide a unique token name.
           #. Set your token strength to ``strong (longer token)``. This generates a strong, completely unique token that is difficult to guess with brute force methods.
           #. Set the required scopes for your use case. 
           #. Set the expiration date.

           A notification appears containing your token. 
           
        .. tip::
           You can view the token at any time at the bottom of the **Access** page.

        #. Click **Create**.

.. note::

            If your token expires, :ref:`revoke the token <cloud-accounts-revoke-token>` and create a new one.

.. _cloud-accounts-revoke-token:

Revoking tokens
---------------

You can revoke tokens directly on Anaconda.org or from the command line interface (CLI). 

.. tab-set::

    .. tab-item:: CLI

        #. Open Anaconda Prompt (Terminal on macOS/Linux) and run the following command::

            # Replace <YOUR_TOKEN_NAME> with the name of the token you want to revoke
            anaconda auth --remove <YOUR_TOKEN_NAME>

    .. tab-item:: Anaconda.org

         #. Log in to Anaconda.org.
         #. From your profile in the top-right corner, select **Settings**.
         #. Click **Access** in the left-hand menu. 
         #. At the bottom of the page, click the name of the token you want to revoke.
         #. Click **Revoke Token**.