To use applications that use Keycloak for authentication and authorization, we need a user to log in. Usually, in large systems, the user information will be stored in Active Directory (AD) or LDAP, Keycloak can connect to these systems to retrieve user information. It can also store user information directly. In this tutorial, I will show you how to create a new user in Keycloak!
First, you need to login to Keycloak with your admin account, then select the Users menu item on the left. The Users page contents will display as follows:
To add a new user, click the Create new user button.
Username is the username used to log in and this is the information we must enter!
Email is the user’s email.
Email Verified allows us to confirm whether the user’s email is confirmed or not? ON is confirmed and OFF is not yet!
First Name and Last Name are the name of the user.
You can enable or disable the user using the Enabled box with the value ON or OFF.
Required user actions define several operations:
if you want, you can choose to let the user do it.
After filling in the information, you can click the Save button to complete the new creation.
My example is as follows:
Result:
To update your login password information, go to the Credentials tab in this window and then click the Set password button:
Please enter the Password and Password Confirmation.
If this is only a temporary password, the user needs to change the password when logging in, then leave the Temporary box default with the value ON, otherwise, turn it OFF.
Finally, you press the Save button to save this password. The following window will appear:
to confirm that you really want to set a password for this user.
Keep pressing the Save password button to confirm!
Result:
At this point, you can use this user to log into Keycloak server using the URL http://localhost:8080/realms/huongdanjava/account/#/ with huongdanjava is the realm name that I’m using. You will see the following results:
Click the Sign In button, then enter the user information you just created. If the password you have just set is a temporary password, you will see Keycloak ask to change the password as follows:
After entering the new password, you will see the following results: