Keycloak

Prerequisites


Steps on Keycloak Admin Console

Creating a Client

Here, we will add Devtron as a client for using Keycloak SSO.

  1. In the Admin Console, go to Clients and click Create client.

  2. Within General Settings:

    • Enter devtron in the Client ID field. We will use this ID while configuring SSO later in Devtron.

    • Enter Devtron in the Name field.

  3. Within Capability config, turn on Client Authentication.

  4. Within Login settings, enter https://<DEVTRON_BASE_URL>/orchestrator/api/dex/callback in the following fields.

    • Valid redirect URIs

    • Valid post logout redirect URIs

    • Web origins

    Click here to know where to find DEVTRON_BASE_URL.

  5. Click Save.

Getting Client Secret

Here, we will obtain the secret we need while configuring SSO in Devtron.

  1. Go to the Credentials tab of the client you created.

  2. Use the copy button next to the Client Secret field and paste it somewhere for future reference.

Creating Users

Here, we will create a user that can log in to Devtron via SSO. We will assign a username and password that the user can enter while logging in to Devtron via Keycloak SSO.

  1. In the Admin Console, go to Users and click Add user.

  2. Give a username (e.g., usertest) in the Username field and enter the user's email address (e.g., usertest@example.com) in the Email field.

  3. Click Create. Your user creation will be successful.

  4. Go to the Credentials tab of the user you created.

  5. Click Set password.

  6. Enter the password and confirm it.

  7. Click Save.

Retrieving Issuer URL

Here, we will obtain the Issuer URL we need while configuring SSO in Devtron.

  1. In the Admin Console, go to Realm settings.

  2. In the General tab, scroll down to the Endpoints field, and click the OpenID Endpoint Configuration link.

  3. This will open a new page, copy the value of the key named issuer, and paste it somewhere for future reference.


Steps on Devtron

Configuring OIDC SSO

Who Can Perform This Action?

Users need to have super-admin permission to configure SSO.

Here, we will set up an OIDC SSO and enter the values we obtained in the previous section.

  1. Go to Global ConfigurationsSSO Login ServicesOIDC.

  2. Below the URL field, take the help of the Click to use option to populate the exact URL if the displayed one is incorrect.

  3. In the Configuration editor, do the following:

  4. Click Save or Update to activate Keycloak SSO login.

Adding Users

Who Can Perform This Action?

Users need to have super-admin permission to add users.

Here, we will add the user we created in the Keycloak Admin Console. If this step is skipped, the user might not be able to log in to Devtron via Keycloak.

  1. Go to Global ConfigurationsAuthorizationUser Permissions.

  2. Click + Add Users.

  3. In the Email addresses field, enter the email address of the user you created in Keycloak.

  4. Assign necessary permissions to this new user. Refer user permissions to know more.

  5. Click Save.

Now, you may log out and test the Keycloak OIDC login method using the user credentials. Clicking the Login with Oidc button will land you on Keycloak's login page.

Note

Kindly get in touch with us if you encounter any issues while logging out of Keycloak on Devtron as it might be buggy.

Last updated