Skip to content

Commit 8e2ecdd

Browse files
authored
Update keycloak-setup.md for Keycloak > 18
1 parent 7dfe6de commit 8e2ecdd

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

content/nim/admin-guide/authentication/oidc/keycloak-setup.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,16 @@ Follow these steps to configure Keycloak.
4747

4848
After the client is created, configure it as follows:
4949

50+
If Keycloak is version < 18.x
51+
5052
1. On the **Settings** tab, in the **Access Type** list, select **confidential**.
5153
2. On the **Mappers** tab, select **Add Builtin**, and select **groups**. This exports the user's Keycloak Realm Role information for NGINX Instance Manager to use.
5254

55+
If Keycloak is version >= 18.x
56+
57+
1. On the **Settings** tab, enable the **Client authentication** toggle under the Capability config. Also, enable the **Direct Access Grants** and **Service Account** roles in the **Authentication flow** section.
58+
2. Select the **Client Scopes** tab, under the list of scopes click on the scope with the name **<client_name>-dedicated (nim-dedicated)**. Under the **Mappers** tab, click **Configure new Mapper** and select **From predefined mappers**. In the **Add predefined mappers** section, search for **groups** mapper and select **Add groups mapper**.
59+
5360
### Create Keycloak Roles
5461

5562
NGINX Instance Manager User Groups will map to Keycloak **Realm Roles**; Keycloak Client Roles are **not** mapped. Use Keycloak top-level roles (Realm Roles).
@@ -119,6 +126,8 @@ To configure NGINX Instance Manager with the necessary OIDC settings, follow the
119126

120127
- Export the environment variables:
121128

129+
If Keycloak is version < 18.x:
130+
122131
```bash
123132
# Either the FQDN or the IP address is suitable for these environment variables.
124133
export KEYCLOAK_IP="<insert-keycloak-IP>"
@@ -134,6 +143,23 @@ To configure NGINX Instance Manager with the necessary OIDC settings, follow the
134143
export KEYCLOAK_KEYS_ENDPOINT=$(curl -k "https://$KEYCLOAK_IP:8443/auth/realms/<realm-name>/.well-known/openid-configuration" | jq -r ".jwks_uri")
135144
```
136145

146+
If Keycloak is version >= 18.x (‘/auth’ path is no longer needed):
147+
148+
```bash
149+
# Either the FQDN or the IP address is suitable for these environment variables.
150+
export KEYCLOAK_IP="<insert-keycloak-IP>"
151+
export NIM_IP="<insert-NIM-IP>"
152+
export KEYCLOAK_CLIENT_ID="<insert-keycloak-client-id>"
153+
export KEYCLOAK_CLIENT_SECRET="<insert-kecloak-client-secret>"
154+
155+
# Choose an appropriate Hash-Based Message Authentication Code (HMAC)
156+
export HMAC_KEY="<insert-HMAC>"
157+
158+
export KEYCLOAK_AUTH_ENDPOINT=$(curl -k “https://$KEYCLOAK_IP:8443/realms/<realm-name>/.well-known/openid-configuration” | jq -r “.authorization_endpoint”)
159+
export KEYCLOAK_TOKEN_ENDPOINT=$(curl -k “https://$KEYCLOAK_IP:8443/realms/<realm-name>/.well-known/openid-configuration” | jq -r “.token_endpoint”)
160+
export KEYCLOAK_KEYS_ENDPOINT=$(curl -k “https://$KEYCLOAK_IP:8443/realms/<realm-name>/.well-known/openid-configuration” | jq -r “.jwks_uri”)
161+
```
162+
137163
- Back up the original configuration files:
138164

139165
```bash

0 commit comments

Comments
 (0)