The following manual procedure can be used to create a user in the Keycloak Shasta
realm. New accounts can be created with the Keycloak UI.
New administrator and user accounts are authenticated with Keycloak. Authenticated accounts are needed to use the Cray CLI.
This procedure assumes that the password for the Keycloak admin
account is known. The Keycloak password is set during the software installation process. The password can be obtained with the following command:
ncn-mw# kubectl get secret -n services keycloak-master-admin-auth --template={{.data.password}} | base64 --decode
Log in to the administration console.
See Access the Keycloak User Management UI for more information.
Click the Add User
button.
Enter the user name and other attributes as required.
Click the Save
button.
In the Credentials
tab, enter a password for the user and change the temporary option from ON
to OFF
.
Click the Reset Password
button.
Click the red Change Password
button on the Change Password
page.
Remove Update Password
from the Required User Actions
and on the user Details
tab.
This step allows the user to authenticate and get a token without first needing to change the administrator-supplied password. It does not prevent the user from changing the password. It is also acceptable to leave this setting, which means a password reset in Keycloak will be required before making a token request with this user account.
Click the Save
button.
Create a user and group ID for this user.
The User Access Service (UAS) requires these attributes. In the Attributes
tab, performing the following steps for both the uid
and gid
attributes:
Add the attribute name to the Key
column and its value to the Value
column.
Click the Add
button.
Click the Save
button at the bottom once both the uid
and gid
attributes have been added.
Optionally add other attributes.
Other attributes can be added as needed by site-specific applications.
User accounts need the following attributes defined in order to create a User Access Instance (UAI):
gidNumber
homeDirectory
loginShell
uidNumber
Click on the Role Mappings
tab to grant the user authority.
Click the Client Roles
button.
Select Shasta
.
Set the assigned role to either admin
or user
.
Verify that the user account has been created in the Shasta
realm.
This can be verified by performing one or more of the following checks:
Manage Users
on the Administration Console
page.Shasta
realm as the new user.
Verify that the new local Keycloak account can authenticate to the Cray CLI.
NOTE: Authorization with the Cray CLI is local to a host. The first time the CLI is used on a host where it has not been used before, it is first necessary to authenticate on that host. There is no provided mechanism to distribute CLI authorization across hosts.
For additional information, see Configure the Cray CLI.
linux# cray auth login --username USERNAME