This guide provides step-by-step instructions for setting up Keycloak for your project.
- Navigate to the Keycloak Admin Console at
http://<keycloak-server>/auth/admin/
. - Enter your admin credentials to log in.
- Click on "Add Realm" in the admin console.
- Enter the realm name as
wallet-realm
and save.
- Navigate to
wallet-realm
. - Go to the "Clients" section.
- Click "Create" and enter the client name as
wallet-app
. - For "Web Origins", enter the domain name of the frontend app or use
*
for testing purposes.
- Navigate to the "Users" section within
wallet-realm
. - Click "Add User" and fill in all the user fields.
- Ensure "Email Verified" is enabled.
- Under the "Credentials" tab for the user, create a password.
- Uncheck the "Temporary" option to make the password permanent.
- Go to the
wallet-app
client under the "Clients" section. - Enable "Client Authentication" under the "Capability Config" section and save.
- A new tab named "Credentials" will appear.
- Set the environment variable
KC_CLIENT_ID
with this value.
- Under "Realm Settings" for
wallet-realm
, navigate to the "Keys" tab. - Copy the RS256 Public Key.
- Set the environment variable
KC_REALM_PUBLIC_KEY
with this value.
- Ensure that all configurations are saved after each step.
- For production environments, replace
*
in "Web Origins" with the actual domain name of your frontend application. - Regularly update your Keycloak version to benefit from security patches and new features.
For more detailed information, refer to the Keycloak Documentation.