8 Copyright (C) The Arvados Authors. All rights reserved.
10 SPDX-License-Identifier: CC-BY-SA-3.0
13 This page describes how new users are created and activated.
15 "Browser login and management of API tokens is described here.":{{site.baseurl}}/api/tokens.html
19 After completing the authentication process, a callback is made from the SSO server to the API server, providing a user record and @identity_url@ (despite the name, this is actually an Arvados user uuid).
21 The API server searches for a user record with the @identity_url@ supplied by the SSO. If found, that user account will be used, unless the account has @redirect_to_user_uuid@ set, in which case it will use the user in @redirect_to_user_uuid@ instead (this is used for the "link account":{{site.baseurl}}/user/topics/link-accounts.html feature).
23 Next, it searches by email address for a "pre-activated account.":#pre-activated
25 If no existing user record is found, a new user object will be created.
27 A federated user follows a slightly different flow, whereby a special token is presented and the API server verifies user's identity with the home cluster, however it also results in a user object (representing the remote user) being created.
31 If @auto_setup_new_users@ is true, as part of creating the new user object, the user is immediately set up with:
33 * @can_login@ @permission@ link going (email address → user uuid) which records @identity_url_prefix@
34 * Membership in the "All users" group (can read all users, all users can see new user)
35 * A new git repo and @can_manage@ permission if @auto_setup_new_users_with_repository@ is true
36 * @can_login@ permission to a shell node if @auto_setup_new_users_with_vm_uuid@ is set to the uuid of a vm
38 Otherwise, an admin must explicitly invoke "setup" on the user via workbench or the API.
42 A newly created user is inactive (@is_active@ is false) by default unless @new_users_are_active@.
44 An inactive user cannot create or update any object, but can read Arvados objects that the user account has permission to read. This implies that if @auto_setup_new_users@ is true, an "inactive" user who has been set up may still be able to do things, such as read things shared with "All users", clone and push to the git repository, or login to a VM.
47 Maybe these services should check is_active.
49 I believe that when this was originally designed, being able to access git and VM required an ssh key, and an inactive user could not register an ssh key because that required creating a record. However, it is now possible to authenticate to shell VMs and http+git with just an API token.
52 At this point, there are two ways a user can be activated.
54 # An admin can set the @is_active@ field directly. This runs @setup_on_activate@ which sets up oid_login_perm and group membership, but does not set repo or vm (even if if @auto_setup_new_users_with_repository@ and/or @auto_setup_new_users_with_vm_uuid@ are set).
55 # Self-activation using the @activate@ method of the users controller.
59 The @activate@ method of the users controller checks if the user @is_invited@ and whether the user has "signed" all the user agreements.
61 @is_invited@ is true if any of these are true:
63 * @new_users_are_active@ is true
64 * the user account has a permission link to read the system "all users" group.
66 User agreements are accessed by getting a listing on the @user_agreements@ endpoint. This returns a list of collection uuids. This is executed as a system user, so it bypasses normal read permission checks.
68 The available user agreements are represented in the Links table as @link_class: signature@ and @name: require@ and (system_user_uuid → uuid of collection containing user agreement text file)
70 On workbench, it checks @is_invited@. If true, it displays the clickthrough agreements which the user can "sign". If @is_invited@ is false, the user ends up at the "inactive user" page.
72 The @user_agreements/sign@ endpoint creates a Link with @link_class: signature@ and @name: click@ and (current user uuid → collection uuid). This is executed as a system user, so it bypasses the restriction that inactive users cannot create objects.
74 The @user_agreements/signatures@ endpoint returns the list of Link objects that represent signatures by the current user (created by @sign@).
78 The user profile is checked by workbench after checking if user agreements need to be signed. The requirement to fill out the user profile is not enforced by the API server.
80 h3(#pre-activated). Pre-activated user accounts
82 It is possible to create a user account for a user that has not yet logged in.
84 # As an admin, create a user object.
85 # Create a link with @link_class: permission@ and @name: can_login@ and (email address → user_uuid) and @properties[identity_url_prefix] = 'xxxxx-tpzed-'@ where 'xxxxx' is the @uuid_prefix@ of the SSO server.
86 # When the user logs in the first time, the email address will be recognized and the user will be associated with the existing user uuid.
90 In the API server config, set @auto_activate_users_from@ with a list of cluster ids. A federated users from one of the listed clusters which @is_active@ on the home cluster will be automatically set up and activated on this cluster.
92 h3(#deactivating_users). Deactivating users
94 Setting @is_active@ is not sufficient to lock out a user. The user can call @activate@ to become active again. Instead, use @unsetup@:
96 * Delete oid_login_perms
97 * Delete git repository permission links
98 * Delete VM login permission links
99 * Remove from "All users" group
100 * Delete any "signatures"
101 * Clear preferences / profile
105 Does not revoke @is_admin@ though! Maybe we need to fix that?
107 Does not prevent user from reading things.
109 Does not revoke API tokens.
116 Policy: users must be manually approved.
119 auto_setup_new_users: false
120 new_users_are_active: false
123 # User is created. Not set up. @is_active@ is false.
124 # Workbench checks @is_invited@ and finds it is false. User gets "inactive user" page.
125 # Admin goes to user page and clicks either "setup user" or manually @is_active@ to true.
126 # Clicking "setup user" sets up the user. This includes adding the user to "All users" which qualifies the user as @is_invited@.
127 # On refreshing workbench, the user is still inactive, but is able to self-activate after signing clickthrough agreements (if any).
128 # Alternately, directly setting @is_active@ to true also sets up the user, but workbench won't display clickthrough agreements (because the user is already active).
130 h4. Federated instance
132 Policy: users from other clusters in the federation are activated, users from outside the federation must be manually approved
135 auto_setup_new_users: false
136 new_users_are_active: false
137 auto_activate_users_from: [home1]
140 # Federated user arrives claiming to be from cluster 'home1'
141 # API server authenticates user as being from cluster 'home1'
142 # Because 'home1' is in @auto_activate_users_from@ the user is set up and activated.
143 # User can immediately start using workbench.
147 Policy: anybody who shows up and signs the agreements is activated.
150 auto_setup_new_users: true
151 new_users_are_active: false
154 # User is created and auto-setup. At this point, @is_active@ is false, but user has been added to "All users" group.
155 # Workbench checks @is_invited@ and finds it is true, because the user is a member of "All users" group.
156 # Workbench presents user with list of user agreements, user reads and clicks "sign" for each one.
157 # Workbench tries to activate user.
160 h4. Developer instance
162 Policy: avoid wasting developer's time during development/testing
165 auto_setup_new_users: true
166 new_users_are_active: true
169 # User is created, immediately auto-setup, and auto-activated.
170 # User can immediately start using workbench.