Skip to content

Commit ed2ca07

Browse files
author
Frederic Mercier
committed
Keycloak article review for 9.5
1 parent cbeed26 commit ed2ca07

File tree

2 files changed

+40
-33
lines changed

2 files changed

+40
-33
lines changed

authentication/Keycloak/README.md

Lines changed: 40 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ You can create roles and grant these roles directly to an individual user, or ev
172172
* resDeployers
173173
* resExecutors
174174

175-
For more information about ODM groups and roles, refer to the [ODM on Kubernetes documentation](https://www.ibm.com/docs/en/odm/9.0.0?topic=access-user-roles-groups).
175+
For more information about ODM groups and roles, refer to the [ODM on Kubernetes documentation](https://www.ibm.com/docs/en/odm/9.5.0?topic=access-user-roles-groups).
176176

177177

178178
2. Create a group for ODM administrators.
@@ -184,7 +184,7 @@ You can create roles and grant these roles directly to an individual user, or ev
184184
![Create Group](images/create_group.png)
185185

186186
In Menu **Manage** / **Groups**:
187-
* Click **Create odm-admin**
187+
* Click **odm-admin** to edit the new group
188188
* Click the **Role mapping** tab
189189
* Click **Assign role**
190190
* Select "Filter by realm roles"
@@ -196,13 +196,12 @@ You can create roles and grant these roles directly to an individual user, or ev
196196
3. Create at least one user that belongs to this new group.
197197

198198
In Menu **Manage** / **Users**:
199-
* Click **Create new user**
199+
* Click **Add user**
200+
* Email verified: On
200201
* Username: ``johndoe@mynicecompany.com``
201202
* Email: ``johndoe@mynicecompany.com``
202-
* Email Verified: On
203203
* First name: ``John``
204204
* Last name: ``Doe``
205-
* Enabled: On
206205
* Required user actions: nothing
207206
* Groups : Click **Join Groups** , select ***odm-admin***, and click **Join**
208207
* Click **Create**
@@ -213,22 +212,25 @@ You can create roles and grant these roles directly to an individual user, or ev
213212
* Click **Set password**
214213
* Fill the Password and Password confirmation fields with **johndoe**
215214
* Temporary: Off
216-
* Click *Save Password*
215+
* Click **Save**
217216
* Click the **Details** tab
218-
* Click **Save**
217+
* Click **Save**
218+
* clicking **Save password** to confirm
219219

220220
(Optional) Every user is created with a predefined role named **default-roles-<CLIENT_ID>**.
221221
This role has no interest. So, here is the way to unassign this role.
222222

223223
* In User Details, select the **Role mapping** tab
224224
* Select **default-roles-<CLIENT_ID>**
225225
* Click **Unassign**
226-
* Click **Remove**
227-
* Click the **Details** tab
228-
* Click **Save**
226+
* Click **Remove** to confirm
229227

230228
![Unassign default role](images/unassign_default_role.png)
231229

230+
* Click the **Details** tab
231+
* Make sure the toggle **Enabled** is on
232+
* Click **Save**
233+
232234
Repeat those steps for each user you want to add.
233235

234236
## Set up the client
@@ -239,7 +241,7 @@ You can create roles and grant these roles directly to an individual user, or ev
239241
* Client type: **OpenID Connect**
240242
* Client ID: **odm**
241243
* Name: **ODM Application**
242-
* Always display in console: On
244+
* Always display in UI: On
243245
* Click **Next**
244246

245247
![Create Client 1](images/create_client_1.png)
@@ -259,7 +261,7 @@ You can create roles and grant these roles directly to an individual user, or ev
259261

260262
![Get Client Secret](images/client_secret.png)
261263

262-
* Click the **Service account roles** tab
264+
* Click the **Service accounts roles** tab
263265
* Click the **Assign role** button.
264266
* Select **Filter by realm roles**
265267
* Select all res* and rts* roles in the list and click the **Assign** button.
@@ -270,12 +272,13 @@ You can create roles and grant these roles directly to an individual user, or ev
270272
2. Add the GROUPS predefined mapper on the ROLES client scope
271273

272274
* Select the **Manage** / **Client scopes** menu
275+
* Search for the scope : **roles**
273276
* click the **roles** scope
274277
* Select the **Mappers** tab
275278
* Click **Add mapper>From predefined mappers**
276279
* Search for mapper : **groups**
277280
* Select **groups**
278-
* Click *Add*
281+
* Click **Add**
279282

280283
![Add group mapper](images/add_group_mapper_to_role_scope.png)
281284

@@ -293,7 +296,7 @@ You can create roles and grant these roles directly to an individual user, or ev
293296
4.1 Verify the Client Credentials Token
294297

295298
You can request an access token using the Client-Credentials flow to verify the format of the token.
296-
This token is used for the deployment between Decision Center and the Decision Server Console:
299+
This token is used for the deployment of rulesets from the Business Console:
297300

298301
```shell
299302
./get-client-credential-token.sh -i $CLIENT_ID -x $CLIENT_SECRET -n $KEYCLOAK_SERVER_URL
@@ -305,7 +308,7 @@ You can create roles and grant these roles directly to an individual user, or ev
305308
- *CLIENT_SECRET* is listed in your ODM Application, in the **Credentials** tab
306309
- *KEYCLOAK_SERVER_URL* is the issuer that can be retrieved using the **OpenID Endpoint Configuration** link of the **General** tab in the **Configure**/**Realm settings** menu
307310

308-
By introspecting the access_token value with the online tool [https://jwt.io](https://jwt.io), you should get:
311+
By introspecting the access_token value with a JWT decoder tool, you should get:
309312

310313
```
311314
{
@@ -324,16 +327,16 @@ You can create roles and grant these roles directly to an individual user, or ev
324327
This token is used for the invocation of the ODM components like the Decision Center, Decision Server console, and the invocation of the Decision Server Runtime REST API.
325328

326329
```shell
327-
./get-user-password-token.sh -i $CLIENT_ID -x $CLIENT_SECRET -n $KEYCLOAK_SERVER_URL -u <USERNAME> -p <PASSWORD>
330+
./get-user-password-token.sh -i $CLIENT_ID -x $CLIENT_SECRET -n $KEYCLOAK_SERVER_URL -u johndoe@mynicecompany.com -p johndoe
328331
```
329332

330333
Where:
331334
- *CLIENT_ID* is your ODM Application, default is odm, can be retrieved in the **Manage** / **Clients** menu
332335
- *CLIENT_SECRET* is listed in your ODM Application, in the **Credentials** tab
333336
- *KEYCLOAK_SERVER_URL* is the issuer that can be retrieved using the **OpenID Endpoint Configuration** link of the **General** tab in the **Configure**/**Realm settings** menu
334-
- *USERNAME* and *PASSWORD* have been created from 'Create at least one user that belongs to this new group.' section.
337+
- The credentials used are from 'Create at least one user that belongs to this new group.' section.
335338

336-
By introspecting the id_token value with the online tool [https://jwt.io](https://jwt.io), you should get:
339+
By introspecting the id_token value with a JWT decoder tool, you should get:
337340

338341
```
339342
{
@@ -419,8 +422,8 @@ You can create roles and grant these roles directly to an individual user, or ev
419422
- `webSecurity.xml` contains the mapping between Liberty J2EE ODM roles and Keycloak groups and users:
420423
* rtsAdministrators/resAdministrators/resExecutors ODM roles are given to the CLIENT_ID (which is seen as a user) to manage the client-credentials flow
421424
- `openIdWebSecurity.xml` contains two openIdConnectClient Liberty configurations:
422-
* for web access to Decision Center and Decision Server consoles using userIdentifier="preferred_username" with the Authorization Code flow
423-
* for the rest-api call using userIdentifier="preferred_username" with the client-credentials flow
425+
* the first for web access to Decision Center and Decision Server consoles with the Authorization Code flow
426+
* the second for the rest-api calls with the client-credentials flow
424427
- `openIdParameters.properties` configures several features like allowed domains, logout, and some internal ODM openid features
425428
- `ldap-configurations.xml` contains LDAP configuration for [How to import Keycloak Groups and Users using SCIM](README_FINE_GRAIN_PERMISSION.md)
426429

@@ -451,7 +454,7 @@ You can create roles and grant these roles directly to an individual user, or ev
451454
The output should look like:
452455
```shell
453456
NAME CHART VERSION APP VERSION DESCRIPTION
454-
ibm-helm/ibm-odm-prod 24.1.0 9.0.0.1 IBM Operational Decision Manager
457+
ibm-helm/ibm-odm-prod 25.0.0 9.5.0.0 IBM Operational Decision Manager
455458
```
456459

457460
### 3. Run the `helm install` command
@@ -460,10 +463,11 @@ You can now install the product. We will use the PostgreSQL internal database an
460463

461464
#### a. Installation on OpenShift using Routes
462465

463-
See the [Preparing to install](https://www.ibm.com/docs/en/odm/9.0.0?topic=production-preparing-install-operational-decision-manager) documentation for more information.
466+
See the [Preparing to install](https://www.ibm.com/docs/en/odm/9.5.0?topic=production-preparing-install-operational-decision-manager) documentation for more information.
464467

465468
```shell
466469
helm install my-odm-release ibm-helm/ibm-odm-prod \
470+
--version 25.0.0 \
467471
--set image.repository=cp.icr.io/cp/cp4a/odm --set image.pullSecrets=icregistry-secret \
468472
--set oidc.enabled=true \
469473
--set license=true \
@@ -486,6 +490,7 @@ You can now install the product. We will use the PostgreSQL internal database an
486490

487491
```shell
488492
helm install my-odm-release ibm-helm/ibm-odm-prod \
493+
--version 25.0.0 \
489494
--set image.repository=cp.icr.io/cp/cp4a/odm --set image.pullSecrets=icregistry-secret \
490495
--set oidc.enabled=true \
491496
--set license=true \
@@ -504,7 +509,7 @@ You can now install the product. We will use the PostgreSQL internal database an
504509

505510

506511
1. Get the ODM endpoints.
507-
Refer to [this documentation](https://www.ibm.com/docs/en/odm/9.0.0?topic=tasks-configuring-external-access) to retrieve the endpoints.
512+
Refer to [this documentation](https://www.ibm.com/docs/en/odm/9.5.0?topic=tasks-configuring-external-access) to retrieve the endpoints.
508513
For example, on OpenShift you can get the route names and hosts with:
509514

510515
```shell
@@ -561,10 +566,12 @@ You can now install the product. We will use the PostgreSQL internal database an
561566

562567
### Access the ODM services
563568

564-
Well done! You can now connect to ODM using the endpoints you got [earlier](#register-the-odm-redirect-url) and log in as an ODM admin with the account you created in [the first step](#create-a-dedicated-odm-realm) (e.g. johndoe@mycompany.com/johndoe).
569+
Well done! You can now connect to ODM using the endpoints you got [earlier](#register-the-odm-redirect-url) and log in as an ODM admin with the account you created in [the first step](#create-a-dedicated-odm-realm) (e.g. `johndoe@mynicecompany.com` / `johndoe`).
565570

566571
### Set up Rule Designer
567572

573+
First set up Rule Designer following [these instructions](https://www.ibm.com/docs/en/odm/9.5.0?topic=designer-installing-rule-online).
574+
568575
To be able to securely connect your Rule Designer to the Decision Server and Decision Center services that are running in Certified Kubernetes, you need to establish a TLS connection through a security certificate in addition to the OpenID configuration.
569576

570577
1. Get the following configuration files.
@@ -582,31 +589,31 @@ To be able to securely connect your Rule Designer to the Decision Server and Dec
582589
```
583590
Where:
584591
- *changeme* is the fixed password to be used for the default truststore.jks file.
585-
- *ECLIPSEINITDIR* is the Rule Designer installation directory next to the eclipse.ini file.
592+
- *ECLIPSEINITDIR* is the Rule Designer installation directory where the eclipse.ini file is.
586593

587594
4. Restart Rule Designer.
588595

589-
For more information, refer to [this documentation](https://www.ibm.com/docs/en/odm/9.0.0?topic=designer-importing-security-certificate-in-rule).
596+
For more information, refer to [this documentation](https://www.ibm.com/docs/en/odm/9.5.0?topic=designer-importing-security-certificate-in-rule).
590597

591598
### Getting Started with IBM Operational Decision Manager for Containers
592599

593600
Get hands-on experience with IBM Operational Decision Manager in a container environment by following this [Getting started tutorial](https://github.com/DecisionsDev/odm-for-container-getting-started/blob/master/README.md).
594601

595602
### Calling the ODM Runtime Service
596603

597-
To manage ODM runtime calls, we use the [Loan Validation Decision Service project](https://github.com/DecisionsDev/odm-for-container-getting-started/blob/master/Loan%20Validation%20Service.zip)
604+
Log in the Business Console as John Doe (`johndoe@mynicecompany.com` / `johndoe`).
598605

599-
Import the **Loan Validation Service** in Decision Center connected as John Doe.
606+
Import the [Loan Validation Decision Service project](https://github.com/DecisionsDev/odm-for-container-getting-started/blob/master/Loan%20Validation%20Service.zip) if it is not already there.
600607

601608
![Import project](images/import_project.png)
602609

603-
Deploy the **Loan Validation Service** production_deployment ruleapps using the **production deployment** deployment configuration in the Deployments>Configurations tab.
610+
Deploy the **Loan Validation Service** production_deployment ruleapp using the **production deployment** deployment configuration in the Deployments>Configurations tab.
604611

605612
![Deploy project](images/deploy_project.png)
606613

607614
You can retrieve the payload.json from the ODM Decision Server Console or use [the provided payload](payload.json).
608615

609-
As explained in the ODM on Certified Kubernetes documentation [Configuring user access with OpenID](https://www.ibm.com/docs/en/odm/9.0.0?topic=access-configuring-user-openid), we advise you to use basic authentication for the ODM runtime call for better performance and to avoid token expiration and revocation.
616+
As explained in the ODM on Certified Kubernetes documentation [Configuring user access with OpenID](https://www.ibm.com/docs/en/odm/9.5.0?topic=access-configuring-user-openid), we advise you to use basic authentication for the ODM runtime call for better performance and to avoid token expiration and revocation.
610617

611618
You perform a basic authentication ODM runtime call in the following way:
612619

@@ -622,15 +629,15 @@ If you want to perform a bearer authentication ODM runtime call using the Client
622629

623630
```
624631
curl -k -X POST -H "Content-Type: application/x-www-form-urlencoded" \
625-
-d 'client_id=<CLIENT_ID>&scope=openid&client_secret=<CLIENT_SECRET>&grant_type=client_credentials' \
626-
'<KEYCLOAK_SERVER_URL>/protocol/openid-connect/token'
632+
-d "client_id=${CLIENT_ID}&scope=openid&client_secret=${CLIENT_SECRET}&grant_type=client_credentials" \
633+
"${KEYCLOAK_SERVER_URL}/protocol/openid-connect/token"
627634
```
628635

629636
And use the retrieved access token in the following way:
630637

631638
```
632639
curl -H "Content-Type: application/json" -k --data @payload.json \
633-
-H "Authorization: Bearer <ACCESS_TOKEN>" \
640+
-H "Authorization: Bearer <ACCESS_TOKEN>" \
634641
https://<DS_RUNTIME_HOST>/DecisionService/rest/production_deployment/1.0/loan_validation_production/1.0
635642
```
636643

Loading

0 commit comments

Comments
 (0)