Skip to main content

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​

  1. Access the Keycloak Admin Console at https://localhost/keyCloak
  2. Log in using the credentials you configured in your .env file:
KEYCLOAK_ADMIN=your_keycloak_user
KEYCLOAK_ADMIN_PASSWORD=your_keycloak_password
  1. Navigate to the Realms section.
  2. Click Add Realm and specify a name for your new realm: bitdive
  3. Save the configuration.

Step 2: Configure a New Client​

  1. In the newly created realm, go to the Clients section.
  2. Click Create to add a new client.
  3. Provide the following configuration:
    • Client ID: react-client
    • Valid Redirect URIs: https://your-domain/*
    • Web Origins: https://your-domain
  4. Save the client configuration.

Step 3: Create a New User​

  1. Navigate to the Users section of your realm.
  2. Click Add User to create a new user.
  3. Specify a Username for the user.
  4. Save the user configuration.

Set Up the User Password​

  1. Open the created user's settings.
  2. Go to the Credentials tab.
  3. Set a new password and confirm it.
  4. 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:

  1. In your realm, navigate to the Realm roles section.
  2. Click Create role.
  3. Set the Role name to: bitdive_admin
  4. Add a description: "BitDive Administrator Role"
  5. Save the role.

Step 5: Assign Admin Role to User​

  1. Go back to the Users section.
  2. Find and click on the user you want to make an administrator.
  3. Go to the Role mapping tab.
  4. Click Assign role.
  5. Find and select bitdive_admin from the available roles.
  6. 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.