|
| 1 | +# Users and Registration |
| 2 | + |
| 3 | +There are two classes of Workflow users: normal users and administrators. |
| 4 | + |
| 5 | + * Users can use most of the features of Workflow - creating and deploying applications, adding/removing domains, etc. |
| 6 | + * Administrators can perform all the actions that users can, but they also have owner access to all applications. |
| 7 | + |
| 8 | +The first user created on a Workflow installation is automatically an administrator. |
| 9 | + |
| 10 | +## Register with a Controller |
| 11 | + |
| 12 | +Use `deis register` with the [Controller][] URL (supplied by your Deis administrator) |
| 13 | +to create a new account. After successful registration you will be logged in as the new user. |
| 14 | + |
| 15 | + $ deis register http://deis.example.com |
| 16 | + username: myuser |
| 17 | + password: |
| 18 | + password (confirm): |
| 19 | + email: myuser@example.com |
| 20 | + Registered myuser |
| 21 | + Logged in as myuser |
| 22 | + |
| 23 | +!!! important |
| 24 | + The first user to register with Deis Workflow is automatically becomes an administrator. Additional users who register will be ordinary users. |
| 25 | + |
| 26 | +## Controlling Registration Modes |
| 27 | + |
| 28 | +After creating your first user, you may wish to change the registration mode for Deis Workflow. |
| 29 | + |
| 30 | +Deis Workflow supports three registration modes: |
| 31 | + |
| 32 | +| Mode | Description | |
| 33 | +| --- | --- | |
| 34 | +| enabled (default) | Registration is enabled and anyone can register | |
| 35 | +| disabled | Does not allow anyone to register new users. | |
| 36 | +| admin\_only | Only existing admins may register new users | |
| 37 | + |
| 38 | +To modify the registration mode for Workflow you must add or modify the `REGISTRATION_MODE` environment variable. If |
| 39 | +Deis Workflow is already up and running, you may use `kubectl --namespace=deis edit rc deis-controller`: |
| 40 | + |
| 41 | +Find the `REGISTRATION_MODE` environment variable in the template file or add the appropriate section: |
| 42 | + |
| 43 | + |
| 44 | + |
| 45 | +Once you save the Replication Controller configuration, you need to find and delete the controller Pod. |
| 46 | + |
| 47 | +``` |
| 48 | +~ $ kubectl --namespace=deis get po | egrep deis-controller |
| 49 | +deis-controller-lto6v 1/1 Running 1 2h |
| 50 | +~ $ kubectl --namespace=deis delete po deis-controller-lto6v |
| 51 | +pod "deis-controller-lto6v" deleted |
| 52 | +``` |
| 53 | + |
| 54 | +Kubernetes will automatically start a new Pod with the new environment variables set. Note that you will incur downtime |
| 55 | +for the Workflow API only. All running applications will continue to function. |
| 56 | + |
| 57 | +## Promoting users to Administrators |
| 58 | + |
| 59 | +You can use the `deis perms` command to promote a user to an administrator: |
| 60 | + |
| 61 | + $ deis perms:create john --admin |
| 62 | + |
| 63 | +## Login to Workflow |
| 64 | + |
| 65 | +If you already have an account, use `deis login` to authenticate against the Deis Workflow API. |
| 66 | + |
| 67 | + $ deis login http://deis.example.com |
| 68 | + username: deis |
| 69 | + password: |
| 70 | + Logged in as deis |
| 71 | + |
| 72 | +## Logout from Workflow |
| 73 | + |
| 74 | +Logout of an existing controller session using `deis logout`. |
| 75 | + |
| 76 | + $ deis logout |
| 77 | + Logged out as deis |
| 78 | + |
| 79 | +## Verify Your Session |
| 80 | + |
| 81 | +You can verify your client configuration by running `deis whoami`. |
| 82 | + |
| 83 | + $ deis whoami |
| 84 | + You are deis at http://deis.example.com |
| 85 | + |
| 86 | +!!! note |
| 87 | + Session and client configuration is stored in the `~/.deis/client.json` file. |
| 88 | + |
| 89 | +## Re-issuing User Authentication Tokens |
| 90 | + |
| 91 | +The controller API uses a simple token-based HTTP Authentication scheme. Token authentication is appropriate for |
| 92 | +client-server setups, such as native desktop and mobile clients. Each user of the platform is issued a token the first |
| 93 | +time that they sign up on the platform. If this token is compromised, it will need to be regenerated. |
| 94 | + |
| 95 | +A user can regenerate their own token like this: |
| 96 | + |
| 97 | + $ deis auth:regenerate |
| 98 | + |
| 99 | +An administrator can also regenerate the token of another user like this: |
| 100 | + |
| 101 | + $ deis auth:regenerate -u test-user |
| 102 | + |
| 103 | +At this point, the user will no longer be able to authenticate against the controller with his auth token: |
| 104 | + |
| 105 | + $ deis apps |
| 106 | + 401 UNAUTHORIZED |
| 107 | + Detail: |
| 108 | + Invalid token |
| 109 | + |
| 110 | +They will need to log back in to use their new auth token. |
| 111 | + |
| 112 | +If there is a cluster wide security breach, an administrator can regenerate everybody's auth token like this: |
| 113 | + |
| 114 | + $ deis auth:regenerate --all=true |
0 commit comments