=====================
Managing Your Account
=====================

Personal accounts
=================


Overview
~~~~~~~~

This section explains how to create a new account, log in
and out, and access the settings and features of different types of
accounts.

Create new account
~~~~~~~~~~~~~~~~~~~

All Anaconda Repository users can find, download and use packages without logging in.

You'll need an Anaconda Repository account to:

-  access private packages that are shared with you, or
-  author packages (optional).

To sign up for a new Anaconda Repository user account:

If your administrator sent you an email with a login address, username 
and password, use that. Otherwise,

-  In a browser, go to the address your administrator gave you.
-  Make sure the Sign Up tab is active. 

NOTE: There's also a Sign In tab for existing users to sign in.

|Anaconda Repo home page|

-  Select a username.
-  Enter your email address. 
-  Create a password. NOTE: The password must be at least 7 characters
   long.
-  Enter the password again to confirm it.
-  Read and accept the Terms and Conditions.
-  Click the Sign up button. The system creates your user account, logs
   you in, and brings you to your personal Dashboard.

TIP: Anaconda Repository can display a profile photo if you are connected to 
the internet and the email address you used to register is associated 
with a Gravatar account. Go to `gravatar.com <http://gravatar.com>`_ 
to associate your email address or to change your Gravatar profile photo.

While you're logged into Anaconda Repository, the Profile pull-down menu will
appear at the top right of every page. This indicates the name of the currently 
active user or organization.

|Anaconda Repo user toolbar|

The far left button is the Tools pull-down menu. The Tools menu contains the following options:

#. Landscape - Your home page.
#. View All - All packages, notebooks and environments you have created.
#. Packages - Only packages you have created.
#. Notebooks - Only notebooks you have created.
#. Environments - Only environments you have created.
#. Favorites - Packages from other users you have starred
#. Organizations - Link to create a new organization
#. Group Membership - If you are part of an organization, the groups you can access.
#. Labels - Labels you have created, for example test or development. See 
   documentation for additional information.

|Anaconda Repo toolbar menu|

Packages, notebooks and environments that you have created with this account 
appear on this Dashboard. 

See Also: :ref:`Working with Packages <repo-using-packages>`


Reset password
~~~~~~~~~~~~~~

The Sign In screen offers two links to help regain access to your
account:

-  **I forgot my username.** Click this link to have the username
   emailed to the email address of record.
-  **I forgot my password.** Click this link to have a reset password
   link sent to the email address of record. NOTE: The reset password
   link expires within 24 hours. If you no longer have access to the
   email account, ask your administrator for assistance.


.. _repo-using-tokens:

Control access
~~~~~~~~~~~~~~

The best way to manage access is to create
:ref:`Organizations <repo-creating-orgs>` or :ref:`Groups <repo-org-groups>`,
which allow you to set separate permissions per package, notebook or
environment.

You can also control access with the token system.

An access control token is a random alphanumeric token string 
that is inserted into a URL that you give to another 
Anaconda Repository user. The token allows them to download a
package that you have marked private. Only those users with the 
correct access token can access the private file.

You can use tokens to control access to private repositories,
collections, or packages on Anaconda Repository. The degree of
access a token grants is completely configurable when you 
generate it.

Multiple tokens can be generated to control which groups
of users have access to certain features if they have the
appropriate token.

NOTE: Tokens provide access to ALL packages in a 
specified channel. 

Generating tokens
^^^^^^^^^^^^^^^^^

Tokens may be generated using the user interface, or from 
the command line using Anaconda client.

**Method 1.** Use the Web User Interface. Go to::

    https://<your-anaconda-repo>/<channel>/settings/access

NOTE: Substitute the address your administrator gave you for 
<your-anaconda-repo>.

Select a name for the access token and set the required scope:

|Anaconda Repo tokens|

By default, tokens will expire after one year.

**Method 2.** Generate a token using Anaconda client. Open your 
terminal window and enter::

      anaconda auth --create --name YOUR-TOKEN-NAME --scopes 'repos conda:download'

The token in this example provides access to download any of 
your private conda repositories. It can be enabled with the 
``conda config`` command::

      conda config --add channels https://conda.anaconda.org/t/<token>/<channel>


Scopes may be provided as a space separated quoted list. The available scopes are

- ``all``: Allow all operations
- ``api``: Allow all API operations
- ``api:modify-group``: Allow addition and modification of groups
- ``api:read``: Allow read access to the API site
- ``api:write``: Allow write access to the API site
- ``conda``: Allow all operations on Conda repositories
- ``conda:download``: Allow private downloads from Conda repositories
- ``pypi``: Allow all operations on PyPI repositories
- ``pypi:download``: Allow private downloads from PyPI repositories
- ``pypi:upload``: Allow uploads to PyPI repositories
- ``repos``: Allow access to all package repositories

NOTE: A pre-existing token cannot be changed. You must revoke the token,
then create a new one.

Revoking tokens
^^^^^^^^^^^^^^^

Tokens can be revoked from the user interface as follows::

    https://<your-anaconda-repo>/<channel>/settings/access

NOTE: Substitute the address your administrator gave you for 
<your-anaconda-repo>.

or by using Anaconda client::

    anaconda auth -r YOUR-TOKEN-NAME

Organization Accounts
=====================

Users can create :ref:`Anaconda Repository organizations <repo-organizations>`.
Create an organization to:

-  Share packages, environments or notebooks under an organization's
   account rather than your personal account
-  Assign multiple account administrators
-  Assign different access permissions to groups of users and customize
   per-package access by group


.. |Anaconda Repo home page| image:: /img/repo-home.png
.. |Anaconda Repo user toolbar| image:: /img/repo-managing-toolbar-bar.png
.. |Anaconda Repo toolbar menu| image:: /img/repo-managing-toolbar-menu.png
.. |Anaconda Repo tokens| image:: /img/repo-tokens.png
