Skip to content

Commit

Permalink
Synchronize Master to vnext-release (#163)
Browse files Browse the repository at this point in the history
* Update README.md

* Update README_FINE_GRAIN_PERMISSION.md

* Update README_FINE_GRAIN_PERMISSION.md

* https://jsw.ibm.com/browse/DBACLD-97311

* Update README.md

* SiaSin review

* SiaSin review

* Update README.md

---------

Co-authored-by: Mathias Mouly <[email protected]>
  • Loading branch information
lgrateau and mmouly authored Oct 20, 2023
1 parent 976c228 commit d38c78b
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 18 deletions.
53 changes: 37 additions & 16 deletions authentication/AzureAD/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,16 @@ After activating your account by email, you should have access to your Aure AD i

![New Web Application](images/RegisterApp.png)

2. Generate an OpenID client secret.
2. Retrieve Tenant and Client information.

In **Azure Active Directory** / **App Registration**, select **ODM Application** and click **Overview**:

* Application (client) ID: **Client ID**. It will be referenced as `CLIENT_ID` in the next steps.
* Directory (tenant) ID: **Your Tenant ID**. It will be referenced as `TENANT_ID` in the next steps.

![Tenant ID](/images/AzureAD/GetTenantID.png)

3. Generate an OpenID client secret.

In **Azure Active Directory** / **App registrations**, select **ODM Application**:

Expand All @@ -153,7 +162,7 @@ After activating your account by email, you should have access to your Aure AD i

>Important: This client secret can not be revealed later. If you forgot to take note of it, you'll have to create another one.
3. Add Claims.
4. Add Claims.

In **Azure Active Directory** / **App registrations**, select **ODM Application**, and in **Manage / Token Configuration**:

Expand All @@ -178,37 +187,47 @@ After activating your account by email, you should have access to your Aure AD i
* Check Security Groups
* Click Add

4. API Permissions.
5. Create a custom claim named "identity"

To allow ODM rest-api to use the password flow with email as user identifier and the client-credentials flow with client_id as user identifier, we need to create a new claim named "identity" that will take the relevant value according to the flow:

In **Azure Active Directory** / **Enterprise applications**, select **ODM Application**, and in **Manage / Single sign-on**:

* Click on Edit of the "Attributes & Claims" section
* Click + Add new claim
* Name: identity
* Fill 2 Claim conditions in the exact following order:
1. User Type: Any / Scope Groups: 0 / Source: Attribute / Value: <CLIENT_ID>
2. User Type: Members / Scope Groups: 0 / Source: Attribute / Value: user.mail

6. API Permissions.

In **Azure Active Directory** / **App Registration**, select **ODM Application**, and then click **API Permissions**.

* Click Grant Admin Consent for Default Directory

5. Manifest change.
7. Manifest change.

In **Azure Active Directory** / **App Registration**, select **ODM Application**, and then click **Manifest**.

As explained in [accessTokenAcceptedVersion attribute explanation](https://docs.microsoft.com/en-us/azure/active-directory/develop/reference-app-manifest#accesstokenacceptedversion-attribute), change the value to 2 and then click Save.
As explained in [accessTokenAcceptedVersion attribute explanation](https://docs.microsoft.com/en-us/azure/active-directory/develop/reference-app-manifest#accesstokenacceptedversion-attribute), change the value to 2.

ODM OpenID Liberty configuration needs version 2.0 for the issuerIdentifier. See the [openIdWebSecurity.xml](templates/openIdWebSecurity.xml) file.

6. Retrieve Tenant and Client information.

In **Azure Active Directory** / **App Registration**, select **ODM Application** and click **Overview**:

* Application (client) ID: **Client ID**. It will be referenced as `CLIENT_ID` in the next steps.
* Directory (tenant) ID: **Your Tenant ID**. It will be referenced as `TENANT_ID` in the next steps.
It is also necessary to set **acceptMappedClaims** to true to manage claims. Without this setting, you get the exception **AADSTS50146: This application is required to be configured with an application-specific signing key. It is either not configured with one, or the key has expired or is not yet valid.** when requesting a token.

![Tenant ID](images/GetTenantID.png)

7. Check the configuration.
Then, click Save.

8. Check the configuration.

Download the [azuread-odm-script.zip](azuread-odm-script.zip) file to your machine and unzip it in your working directory. This .zip file contains scripts and templates to verify and set up ODM.

7.1 Verify the Client Credential Token
8.1 Verify the Client Credential Token

You can request an access token using the Client-Credentials flow to verify the token format.
This token is used for the deployment between Decision Cennter and the Decision Server console:
This token is used for the deployment between Decision Center and the Decision Server console:

```shell
$ ./get-client-credential-token.sh -i <CLIENT_ID> -x <CLIENT_SECRET> -n <TENANT_ID>
Expand All @@ -234,6 +253,7 @@ After activating your account by email, you should have access to your Aure AD i
```json
{
"aud": "<CLIENT_ID>",
"identity": "<CLIENT_ID>",
...
"iss": "https://login.microsoftonline.com/<TENANT_ID>/v2.0",
...
Expand All @@ -245,7 +265,7 @@ After activating your account by email, you should have access to your Aure AD i
- *aud*: should be your CLIENT_ID
- *iss*: should end with 2.0. otherwise you should verify the previous step **Manifest change**

7.2 Verify the Client Password Token.
8.2 Verify the Client Password Token.

To check that it has been correctly taken into account, you can request an ID token using the Client password flow.

Expand All @@ -270,6 +290,7 @@ After activating your account by email, you should have access to your Aure AD i
"iss": "https://login.microsoftonline.com/<TENANT_ID>/v2.0",
...
"email": "<USERNAME>",
"identity": "<USERNAME>",
"groups": [
"<GROUP>"
],
Expand Down Expand Up @@ -546,7 +567,7 @@ Get hands-on experience with IBM Operational Decision Manager in a container env
To manage ODM runtime call on the next steps, we used the [Loan Validation Decision Service project](https://github.com/DecisionsDev/odm-for-container-getting-started/blob/master/Loan%20Validation%20Service.zip)
Import the **Loan Validation Service** in Decision Center connected as John Doe
Import the **Loan Validation Service** in Decision Center connected using *myodmuser*@YOURDOMAIN created at step 2
![Import project](../Keycloak/images/import_project.png)
Expand Down
Binary file modified authentication/AzureAD/azuread-odm-script.zip
Binary file not shown.
4 changes: 2 additions & 2 deletions authentication/AzureAD/templates/openIdWebSecurity.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,5 @@
issuerIdentifier="${ServerHost}/v2.0"
authorizationEndpointUrl="${ServerHost}/oauth2/v2.0/authorize"
tokenEndpointUrl="${ServerHost}/oauth2/v2.0/token"
userIdentifier="aud" groupIdentifier="groups" audiences="ALL_AUDIENCES"/>
</server>
userIdentifier="identity" groupIdentifier="groups" audiences="ALL_AUDIENCES"/>
</server>
1 change: 1 addition & 0 deletions authentication/Keycloak/README_FINE_GRAIN_PERMISSION.md
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,7 @@ oc exec -ti <OPENLDAP_POD> bash -- ldapsearch -x -Z -H ldap://ldap-service.<PROJ

By default, the SCIM Groups and Users Endpoints require authentication.


![SCIM Resources Tab](images/scim_resources.png)

Now, we will configure these endpoints to authorize authenticated users that have the rtsAdministrators role. In the ODM client application, we will use the client_credentials flow using the "service-account-odm" service account having assigned the rtsAdministrators role. We just have to configure authorization for the "Get" endpoint as the ODM SCIM Import is a read only mode and doesn't need the other endpoints (Create, Update, Delete)
Expand Down

0 comments on commit d38c78b

Please sign in to comment.