Skip to content

Commit cca54df

Browse files
Update keycloak-setup.md for Keycloak > 18 (#45)
### Proposed changes Problem: To configure OpenID Connect with Keycloak for NIM authentication, there are new instructions for Keycloak >18 due to UI changes on the latest version. Solution: We added those new steps in the documentation. Testing: Instructions validated and tested by dev and qe ### Checklist Before creating a PR, run through this checklist and mark each as complete. - [ ] I have read the [contributing guidelines](/CONTRIBUTING.md) - [ ] I have signed the [F5 Contributor License Agreement (CLA)](https://github.com/f5/.github/blob/main/CLA/cla-markdown.md) - [ ] If applicable, I have added tests that prove my fix is effective or that my feature works - [ ] If applicable, I have checked that any relevant tests pass after adding my changes - [ ] I have updated any relevant documentation ([`README.md`](/README.md) and [`CHANGELOG.md`](/CHANGELOG.md)) - [ ] I have rebased my branch onto main - [ ] I will ensure my PR is targeting the main branch and pulling from my branch from my own fork - [ ] If the change involves: - Code - Anything that resembles Personally identifying information (PII) - Make sure to use placeholders such as `<username>` in place of PII - URLs (watch for [typosquatting](https://support.microsoft.com/en-us/topic/what-is-typosquatting-54a18872-8459-4d47-b3e3-d84d9a362eb0)) - Significant new/revised content In these cases, the change will require at least two (2) approvals before merging
2 parents 7dfe6de + f7a6825 commit cca54df

File tree

1 file changed

+40
-2
lines changed

1 file changed

+40
-2
lines changed

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

Lines changed: 40 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,19 @@ Follow these steps to configure Keycloak.
4747

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

50-
1. On the **Settings** tab, in the **Access Type** list, select **confidential**.
51-
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.
50+
#### For Keycloak versions earlier than 18.x
51+
52+
1. On the **Settings** tab, set **Access Type** to **confidential**.
53+
2. On the **Mappers** tab, select **Add Builtin** and choose **groups** to export Keycloak Realm Role information for NGINX Instance Manager.
54+
55+
#### For Keycloak versions 18.x and later
56+
57+
1. On the **Settings** tab, under **Capability config**, enable **Client authentication**.
58+
2. In the **Authentication flow** section, enable **Direct Access Grants** and **Service Account**.
59+
3. Go to the **Client Scopes** tab.
60+
- Select the scope named **<client_name>-dedicated (nim-dedicated)**.
61+
- On the **Mappers** tab, click **Configure new Mapper** and choose **From predefined mappers**.
62+
- Search for **groups** and select **Add groups mapper**.
5263

5364
### Create Keycloak Roles
5465

@@ -119,6 +130,8 @@ To configure NGINX Instance Manager with the necessary OIDC settings, follow the
119130

120131
- Export the environment variables:
121132

133+
- **For Keycloak versions earlier than 18.x**:
134+
122135
```bash
123136
# Either the FQDN or the IP address is suitable for these environment variables.
124137
export KEYCLOAK_IP="<insert-keycloak-IP>"
@@ -134,6 +147,31 @@ To configure NGINX Instance Manager with the necessary OIDC settings, follow the
134147
export KEYCLOAK_KEYS_ENDPOINT=$(curl -k "https://$KEYCLOAK_IP:8443/auth/realms/<realm-name>/.well-known/openid-configuration" | jq -r ".jwks_uri")
135148
```
136149

150+
- **For Keycloak versions 18.x and later**:
151+
152+
```bash
153+
# Either the FQDN or the IP address is suitable for these environment variables.
154+
export KEYCLOAK_IP="<insert-keycloak-IP>"
155+
export NIM_IP="<insert-NIM-IP>"
156+
export KEYCLOAK_CLIENT_ID="<insert-keycloak-client-id>"
157+
export KEYCLOAK_CLIENT_SECRET="<insert-kecloak-client-secret>"
158+
159+
# Choose an appropriate Hash-Based Message Authentication Code (HMAC)
160+
export HMAC_KEY="<insert-HMAC>"
161+
162+
export KEYCLOAK_AUTH_ENDPOINT=$(curl -k \
163+
"https://$KEYCLOAK_IP:8443/realms/<realm-name>/.well-known/openid-configuration" | \
164+
jq -r ".authorization_endpoint")
165+
166+
export KEYCLOAK_TOKEN_ENDPOINT=$(curl -k \
167+
"https://$KEYCLOAK_IP:8443/realms/<realm-name>/.well-known/openid-configuration" | \
168+
jq -r ".token_endpoint")
169+
170+
export KEYCLOAK_KEYS_ENDPOINT=$(curl -k \
171+
"https://$KEYCLOAK_IP:8443/realms/<realm-name>/.well-known/openid-configuration" | \
172+
jq -r ".jwks_uri")
173+
```
174+
137175
- Back up the original configuration files:
138176

139177
```bash

0 commit comments

Comments
 (0)