> ## Documentation Index
> Fetch the complete documentation index at: https://docs.open-metadata.org/llms.txt
> Use this file to discover all available pages before exploring further.

# Auth code flow of Keyclock | Official Documentation

> Implement Keycloak’s Authorization Code Flow for backend-based secure logins using token exchange, identity claims, and session control.

# Auth Code Flow

### Step 1: Create OpenMetadata as a new Client

* Click on `Clients` in the menu.
* Click on `Create Client` button.
* Select the `Client type`.
* Enter the `Client ID`.
* Enter the Name and Description `(Optional)`.
* Click on `Next` button.

![add-client](https://mintcdn.com/openmetadata/4v9U2L_k1HcJVnXe/public/images/deployment/security/keycloak/keycloak-step-3.png?fit=max\&auto=format\&n=4v9U2L_k1HcJVnXe\&q=85\&s=42fcd94e9d8f8aae122450d8b488d3b0)

### Step 2: Edit Configs of the client

* Enable `Client authentication` and `Authorization`.
* Select `Standard flow` as an `Authentication flow`.
* Click `Next`.

![compatibility configs](https://mintcdn.com/openmetadata/4v9U2L_k1HcJVnXe/public/images/deployment/security/keycloak/keycloak-step-4.png?fit=max\&auto=format\&n=4v9U2L_k1HcJVnXe\&q=85\&s=6bf3f6f87c2e8b41cef81cbd4ea52a6a)

### Step 3: Add Login Settings

* fill the required options

![edit-settings-url.png](https://mintcdn.com/openmetadata/4v9U2L_k1HcJVnXe/public/images/deployment/security/keycloak/keycloak-step-5.png?fit=max\&auto=format\&n=4v9U2L_k1HcJVnXe\&q=85\&s=49e025c77312a394182b3ac7e2d9600a)

* Click on `Save` button.

> [!TIP]
>
> Note: Scopes `openid`, `email` & `profile` are required to fetch the user details so you will have to add these scopes in your client.

### Step 3: Where to Find the Credentials

* Navigate to the `Credentials` tab.
* You will find your `Client Secret` related to the Client id "open-metadata"

![client-credentials](https://mintcdn.com/openmetadata/4v9U2L_k1HcJVnXe/public/images/deployment/security/keycloak/keycloak-step-6.png?fit=max\&auto=format\&n=4v9U2L_k1HcJVnXe\&q=85\&s=7e8dd07cba39db373b16d9f11114ff2a)

After the applying these steps, the users in your realm are able to login in the openmetadata, as a suggestion create a user called "admin-user". Now you can update the configuration of your deployment:

> [card] [Docker Security](https://docs.open-metadata.org/v2.1.x/deployment/security/keycloak/docker.md)
>
> Configure Keycloak SSO for your Docker Deployment.

> [card] [Bare Metal Security](https://docs.open-metadata.org/v2.1.x/deployment/security/keycloak/bare-metal.md)
>
> Configure Keycloak SSO for your Bare Metal Deployment.

> [card] [Kubernetes Security](https://docs.open-metadata.org/v2.1.x/deployment/security/keycloak/kubernetes.md)
>
> Configure Keycloak SSO for your Kubernetes Deployment.

> [card] [KeyCloak](https://docs.open-metadata.org/v2.1.x/deployment/security/keycloak.md)
>
> Go to KeyCloak Configuration


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.