Keycloak Realm Setup for BitDive
This guide explains how to create a new Keycloak realm, configure a client, and set up a user for the BitDive application.
Step 1: Create a New Realm​
- Access the Keycloak Admin Console at
https://localhost/keyCloak
- Log in using the credentials you configured in your
.env
file:
KEYCLOAK_ADMIN=your_keycloak_user
KEYCLOAK_ADMIN_PASSWORD=your_keycloak_password
- Navigate to the Realms section.
- Click Add Realm and specify a name for your new realm:
bitdive
- Save the configuration.
Step 2: Configure a New Client​
- In the newly created realm, go to the Clients section.
- Click Create to add a new client.
- Provide the following configuration:
- Client ID:
react-client
- Valid Redirect URIs:
https://your-domain/*
- Web Origins:
https://your-domain
- Client ID:
- Save the client configuration.
Step 3: Create a New User​
- Navigate to the Users section of your realm.
- Click Add User to create a new user.
- Specify a Username for the user.
- Save the user configuration.
Set Up the User Password​
- Open the created user's settings.
- Go to the Credentials tab.
- Set a new password and confirm it.
- Optionally, disable Temporary Password if you want the user to keep the password permanently.
Step 4: Create BitDive Admin Role​
To enable user management features in BitDive, you need to create and assign the admin role:
- In your realm, navigate to the Realm roles section.
- Click Create role.
- Set the Role name to:
bitdive_admin
- Add a description: "BitDive Administrator Role"
- Save the role.
Step 5: Assign Admin Role to User​
- Go back to the Users section.
- Find and click on the user you want to make an administrator.
- Go to the Role mapping tab.
- Click Assign role.
- Find and select
bitdive_admin
from the available roles. - Click Assign to add the role to the user.
After completing these steps, the user will have administrator privileges and can access the User Management Dashboard in the BitDive application.
Notes​
- Replace
https://your-domain
with the actual URL of your server (e.g.,https://localhost
for local development). - Ensure the
react-client
matches the client ID used in your application configuration. - The realm name should be
bitdive
to match the application configuration.
This setup ensures that your BitDive application can authenticate users through Keycloak.