15577: Overhaul user and group management documentation
[arvados.git] / doc / admin / activation.html.textile.liquid
1 ---
2 layout: default
3 navsection: admin
4 title: User management
5 ...
6
7 {% comment %}
8 Copyright (C) The Arvados Authors. All rights reserved.
9
10 SPDX-License-Identifier: CC-BY-SA-3.0
11 {% endcomment %}
12
13 This page describes how user accounts are created, set up and activated.
14
15 h2. Authentication
16
17 "Browser login and management of API tokens is described here.":{{site.baseurl}}/api/tokens.html
18
19 After completing the log in and authentication process, the API server receives a user record from the upstream identity provider (Google, LDAP, etc) consisting of the user's name, primary email address, alternate email addresses, and optional unique provider identifier (@identity_url@).
20
21 If a provider identifier is given, the API server searches for a matching user record.
22
23 If a provider identifier is not given, no match is found, it next searches by primary email and then alternate email address.  This enables "provider migration":migrating-providers.html and a "pre-activated accounts.":#pre-activated
24
25 If no user account is found, a new user account is created with the information from the identity provider.
26
27 If a user account has been "linked":{{site.baseurl}}/user/topics/link-accounts.html or "migrated":merge-remote-account.html the API server may follow internal redirects (@redirect_to_user_uuid@) to select the linked or migrated user account.
28
29 h3. Federated Authentication
30
31 A federated user follows a slightly different flow.  The client presents a token issued by the remote cluster.  The local API server contacts the remote cluster to verify the user's identity.  This results in a user object (representing the remote user) being created on the local cluster.  If the user cannot be verified, the token will be rejected.  If the user is inactive on the remote cluster, a user record will be created, but it will also be inactive.
32
33 h2. User activation
34
35 Following authentication, a user record has been found or created.
36
37 !(full-width){{site.baseurl}}/images/user-account-states.svg!
38
39 notextile. <div class="spaced-out">
40
41 # A new user record is not set up, and not active.  An inactive user cannot create or update any object, but can read Arvados objects that the user account has permission to read (such as publicly available items readable by the "anonymous" user).
42 # Using Workbench or the "command line":{{site.baseurl}}/install/cheat_sheet.html , the admin invokes @setup@ on the user.
43 If @Users.AutoSetupNewUsers@ is true, this happens automatically during user creation, so in that case new users start at step (3).
44 The setup method adds the user to the "All users" group.
45 If @Users.AutoSetupNewUsersWithRepository@ is true, a new git repo is created for the user.
46 If @Users.AutoSetupNewUsersWithVmUUID@ is set, the user is given login permission to the specified shell node
47 # User is set up, but still not yet active.  The browser presents "user agreements":#user_agreements (if any) and then invokes the user @activate@ method on the user's behalf.
48 # The user @activate@ method checks that all "user agreements":#user_agreements are signed.  If so, or there are no user agreements, the user is activated.
49 # The user is active.  User has normal access to the system.
50 # From steps (1) and (3), an admin user can directly update the @is_active@ flag.  This bypasses enforcement that user agreements are signed.
51 If the user was not yet set up (still in step (1)), it adds the user to the "All users", but bypasses creating default git repository and assigning default VM access.
52 # An existing user can have their access revoked using @unsetup@ and "ownership reassignment.":reassign-ownership.html .
53 Unsetup removes the user from the "All users" group and makes them inactive, preventing them from re-activating themselves.
54 "Ownership reassignment":reassign-ownership.html moves any objects or permission from the old user to a new user and deletes any credentials for the old user.
55
56 notextile. </div>
57
58 User management can be performed through the web Workbench or the command line.  See "user management at the CLI":{{site.baseurl}}/install/cheat_sheet.html for specific examples.
59
60 h2(#user_agreements). User agreements and self-activation
61
62 The @activate@ method of the users controller checks if the user user account is part of the "All Users" group and whether the user has "signed" all the user agreements.
63
64 User agreements are accessed through the "user_agreements API":{{site.baseurl}}/api/methods/user_agreements.html .  This returns a list of collection records.  This is executed as a system user, so it bypasses normal read permission checks.
65
66 The user agreements that users are required to sign should be added to the @links@ table this way:
67
68 <pre>
69 $ arv link create --link '{
70   "link_class": "signature",
71   "name": "require",
72   "tail_uuid": "*system user uuid*",
73   "head_uuid: "*collection uuid*"
74 }'
75 </pre>
76
77 The collection should contain a single HTML file with the user agreement text.
78
79 Workbench displays the clickthrough agreements which the user can "sign".
80
81 The @user_agreements/sign@ endpoint creates a Link object:
82
83 <pre>
84 {
85   "link_class": "signature"
86   "name": "click",
87   "tail_uuid": "*user uuid*",
88   "head_uuid: "*collection uuid*"
89 }
90 </pre>
91
92 The @user_agreements/signatures@ endpoint returns the list of Link objects that represent signatures by the current user (created by @sign@).
93
94 h2. User profile
95
96 The fields making up the user profile are described in @Workbench.UserProfileFormFields@ .  See "Configuration reference":config.html .
97
98 The user profile is checked by workbench after checking if user agreements need to be signed.  The values entered are stored in the @properties@ field on the user object.  Unlike user agreements, the requirement to fill out the user profile is not enforced by the API server.
99
100 h2(#pre-activated). Pre-setup user by email address
101
102 You may create a user account for a user that has not yet logged in, and identify the user by email address.  This will bypass
103
104 1. As an admin, create a user object:
105
106 <pre>
107 $ arv user create --user '{"email": "foo@example.com", "username": "foo"}'
108 $ arv user setup --uuid clsr1-tpzed-1234567890abcdf
109 </pre>
110
111 2. When the user logs in the first time, the email address will be recognized and the user will be associated with the existing user object.
112
113 h2. Pre-activate federated user
114
115 1. As admin, create a user object with the @uuid@ of the federated user (this is the user's uuid on their home cluster, called @clsr2@ in this example):
116
117 <pre>
118 $ arv user create --user '{"uuid": "clsr2-tpzed-1234567890abcdf", "email": "foo@example.com", "username": "foo", "is_active": true}'
119 </pre>
120
121 2. When the user logs in, they will be associated with the existing user object.
122
123 h2. Auto-setup federated users from trusted clusters
124
125 In the API server config, set @ActivateUsers: true@ for each federated cluster in @RemoteClusters@ .  A federated user from one of the listed clusters which @is_active@ on the home cluster will be automatically set up and activated on this cluster.
126
127 h2. Activation flows
128
129 h3. Private instance
130
131 Policy: users must be manually set up by the admin.
132
133 Here is the configuration for this policy.  This is also the default if not provided.
134 (However, be aware that developer/demo builds such as "arvbox":{{site.baseurl}}/install/arvbox.html are configured with the "Open instance" policy described below.)
135
136 <pre>
137 Users:
138   AutoSetupNewUsers: false
139 </pre>
140
141 # User is created.  Not set up.  @is_active@ is false.
142 # Workbench checks @is_invited@ and finds it is false.  User gets "inactive user" page.
143 # Admin goes to user page and clicks "setup user" or sets @is_active@ to true.
144 # On refreshing workbench, the user is able to self-activate after signing clickthrough agreements (if any).
145 # Alternately, directly setting @is_active@ to true also sets up the user, but skips clickthrough agreements (because the user is already active).
146
147 h3. Federated instance
148
149 Policy: users from other clusters in the federation are activated, users from outside the federation must be manually approved.
150
151 Here is the configuration for this policy and an example remote cluster @clsr2@.
152
153 <pre>
154 Users:
155   AutoSetupNewUsers: false
156 RemoteClusters:
157   clsr2:
158     ActivateUsers: true
159 </pre>
160
161 # Federated user arrives claiming to be from cluster 'clsr2'
162 # API server authenticates user as being from cluster 'clsr2'
163 # Because 'clsr2' has @ActivateUsers@ the user is set up and activated.
164 # User can immediately start using Workbench.
165
166 h3. Open instance
167
168 Policy: anybody who shows up and signs the agreements is activated.
169
170 <pre>
171 Users:
172   AutoSetupNewUsers: true
173 </pre>
174
175 "Set up user agreements":#user_agreements by creating "signature" "require" links as described earlier.
176
177 # User is created and auto-setup.  At this point, @is_active@ is false, but user has been added to "All users" group.
178 # Workbench checks @is_invited@ and finds it is true, because the user is a member of "All users" group.
179 # Workbench presents user with list of user agreements, user reads and clicks "sign" for each one.
180 # Workbench tries to activate user.
181 # User is activated.