Merge branch '20343-regexp-prefixes'
[arvados.git] / doc / user / reference / api-tokens.html.textile.liquid
index b5015d7f029ee70ae0886ea8b50b4b105ffb09ed..4c35530e607d1194ce3827400390c826693407bf 100644 (file)
@@ -3,48 +3,30 @@ layout: default
 navsection: userguide
 title: "Getting an API token"
 ...
+{% comment %}
+Copyright (C) The Arvados Authors. All rights reserved.
 
-The Arvados API token is a secret key that enables the @arv@ command line client to access Arvados with the proper permissions.
+SPDX-License-Identifier: CC-BY-SA-3.0
+{% endcomment %}
 
-Access the Arvados Workbench using this link: "https://{{ site.arvados_workbench_host }}/":https://{{ site.arvados_workbench_host }}/  (Replace @{{ site.arvados_api_host }}@ with the hostname of your local Arvados instance if necessary.)
+The Arvados API token is a secret key that enables the Arvados command line tools to authenticate themselves.
 
-Open a shell on the system where you want to use the Arvados client. This may be your local workstation, or "an Arvados virtual machine accessed with ssh":{{site.baseurl}}/user/getting_started/ssh-access.html.
+Access the Arvados Workbench using this link: "{{site.arvados_workbench_host}}/":{{site.arvados_workbench_host}}/  (Replace the hostname portion with the hostname of your local Arvados instance if necessary.)
 
-Click on the user icon <span class="glyphicon glyphicon-user"></span> in the upper right corner to access the user settings menu.  Click on the menu item *Manage API tokens* to go to the "Api client authorizations" page.
+Open a shell on the system where you want to use the Arvados client. This may be your local workstation, or an Arvados virtual machine accessed with "Webshell":{{site.baseurl}}/user/getting_started/vm-login-with-webshell.html or SSH (instructions for "Unix":{{site.baseurl}}/user/getting_started/ssh-access-unix.html#login or "Windows":{{site.baseurl}}/user/getting_started/ssh-access-windows.html#login).
 
-h2. The easy way
+In the Arvados Workbench, click on the dropdown menu icon <span class="fa fa-lg fa-user"></span> in the upper right corner of the top navigation menu to access the _Account Management_ menu. Then, in the pop-up menu, click on the menu item *Get API token*. This will open a dialog box that lists your current token and the instructions for setting up your environment.
 
-For your convenience, the "Api client authorizations" page on Workbench provides a *Help* tab that includes a command you may copy and paste directly into the shell.  It will look something like this:
+h2. Setting environment variables
 
-bc. ### Pasting the following lines at a shell prompt will allow Arvados SDKs
-### to authenticate to your account, you@example.com
-read ARVADOS_API_TOKEN <<EOF
-2jv9346o396exampledonotuseexampledonotuseexes7j1ld
-EOF
-export ARVADOS_API_TOKEN ARVADOS_API_HOST={{ site.arvados_api_host }}
+In the dialog box opened after clicking on the *Get API token* menu item, there is a sequence of commands you may copy and paste directly into the shell.  It will look something as the following.
 
-* The @read@ command reads text input until @EOF@ (designated by @<<EOF@) and stores it in the @ARVADOS_API_TOKEN@ environment variable.
-* The @export@ command puts a local shell variable into the environment that will be inherited by child processes such as the @arv@ client.
-
-h2. Setting the environment manually
-
-Alternately, look for the column *api_token* contains the actual token string that you will use.  Copy the value of *api_token* for the first row onto the clipboard.
-
-<notextile>
-<pre><code>$ <span class="userinput">export ARVADOS_API_HOST={{ site.arvados_api_host }}</span>
-$ <span class="userinput">export ARVADOS_API_TOKEN=2jv9346o3966345u7ueuim7a1zaaoueo3w90tzq3gx0es7j1ld</span>
-</code></pre>
-</notextile>
+bc. HISTIGNORE=$HISTIGNORE:'export ARVADOS_API_TOKEN=*'
+export ARVADOS_API_TOKEN=2jv9346o396exampledonotuseexampledonotuseexes7j1ld
+export ARVADOS_API_HOST={{ site.arvados_api_host }}
+unset ARVADOS_API_HOST_INSECURE
 
-* @ARVADOS_API_HOST@ tells @arv@ which host to connect to.
-* @ARVADOS_API_TOKEN@ is the secret key used by the Arvados API server to authenticate access.  Its value is the text you copied from the *api_token* column on the Workbench.
-
-If you are connecting to a development instance with a unverified/self-signed SSL certificate, set this variable to skip SSL validation:
-
-<notextile>
-<pre><code>$ <span class="userinput">export ARVADOS_API_HOST_INSECURE=1
-</code></pre>
-</notextile>
+* The @export@ command puts a local shell variable into the environment that will be inherited by child processes such as the @arv@ client.
 
 h2. settings.conf
 
@@ -56,9 +38,12 @@ $ <span class="userinput">echo "ARVADOS_API_TOKEN=$ARVADOS_API_TOKEN" >> ~/.conf
 </code></pre>
 </notextile>
 
+* The output-redirection operator @>@ in the first command will cause the target file @~/.config/arvados/settings.conf@ to be created anew, wiping out the content of any existing file at that path.
+* The @>>@ operator in the second command appends to the target file.
+
 h2. .bashrc
 
-Alternately, you may add the declarations of @ARVADOS_API_HOST@ and @ARVADOS_API_TOKEN@ to the @~/.bashrc@ file on the system on which you intend to use the Arvados client.  If you have already put the variables into the environment following the instructions above, you can use these commands to append the environment variables to your @~/.bashrc@:
+Alternately, you may add the definitions of @ARVADOS_API_HOST@ and @ARVADOS_API_TOKEN@ to the @~/.bashrc@ file on the system where you intend to use the Arvados client.  If you have already put the variables into the environment following the instructions above, you can use the commands below to append to your @~/.bashrc@, which tells Bash to export them as environment variables in newly-started interactive shell sessions:
 
 <notextile>
 <pre><code>$ <span class="userinput">echo "export ARVADOS_API_HOST=$ARVADOS_API_HOST" >> ~/.bashrc</span>