Skip to content

Commit 0da3054

Browse files
authored
Merge pull request #157 from DecisionsDev/azuread-review
Azuread review
2 parents 6a1d1a1 + 5c03b7a commit 0da3054

File tree

3 files changed

+39
-20
lines changed

3 files changed

+39
-20
lines changed

authentication/AzureAD/README.md

Lines changed: 37 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,16 @@ After activating your account by email, you should have access to your Aure AD i
159159

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

162-
2. Generate an OpenID client secret.
162+
2. Retrieve Tenant and Client information.
163+
164+
In **Azure Active Directory** / **App Registration**, select **ODM Application** and click **Overview**:
165+
166+
* Application (client) ID: **Client ID**. It will be referenced as `CLIENT_ID` in the next steps.
167+
* Directory (tenant) ID: **Your Tenant ID**. It will be referenced as `TENANT_ID` in the next steps.
168+
169+
![Tenant ID](/images/AzureAD/GetTenantID.png)
170+
171+
3. Generate an OpenID client secret.
163172

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

@@ -172,7 +181,7 @@ After activating your account by email, you should have access to your Aure AD i
172181

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

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

@@ -197,37 +206,45 @@ After activating your account by email, you should have access to your Aure AD i
197206
* Check Security Groups
198207
* Click Add
199208

200-
4. API Permissions.
209+
5. Create a custom claim named "identity"
210+
211+
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:
212+
213+
In **Azure Active Directory** / **Enterprise applications**, select **ODM Application**, and in **Manage / Single sign-on**:
214+
215+
* Click on Edit of the "Attributes & Claims" section
216+
* Click + Add new claim
217+
* Name: identity
218+
* Fill 2 Claim conditions in the exact following order:
219+
1. User Type: Any / Scope Groups: 0 / Source: Attribute / Value: <CLIENT_ID>
220+
2. User Type: Members / Scope Groups: 0 / Source: Attribute / Value: user.mail
221+
222+
6. API Permissions.
201223

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

204226
* Click Grant Admin Consent for Default Directory
205227

206-
5. Manifest change.
228+
7. Manifest change.
207229

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

210-
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.
232+
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.
211233

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

214-
6. Retrieve Tenant and Client information.
215-
216-
In **Azure Active Directory** / **App Registration**, select **ODM Application** and click **Overview**:
217-
218-
* Application (client) ID: **Client ID**. It will be referenced as `CLIENT_ID` in the next steps.
219-
* Directory (tenant) ID: **Your Tenant ID**. It will be referenced as `TENANT_ID` in the next steps.
220-
221-
![Tenant ID](/images/AzureAD/GetTenantID.png)
236+
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.
222237

223-
7. Check the configuration.
238+
Then, click Save.
239+
240+
8. Check the configuration.
224241

225242
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.
226243

227-
7.1 Verify the Client Credential Token
244+
8.1 Verify the Client Credential Token
228245

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

232249
```shell
233250
$ ./get-client-credential-token.sh -i <CLIENT_ID> -x <CLIENT_SECRET> -n <TENANT_ID>
@@ -253,6 +270,7 @@ After activating your account by email, you should have access to your Aure AD i
253270
```json
254271
{
255272
"aud": "<CLIENT_ID>",
273+
"identity": "<CLIENT_ID>",
256274
...
257275
"iss": "https://login.microsoftonline.com/<TENANT_ID>/v2.0",
258276
...
@@ -264,7 +282,7 @@ After activating your account by email, you should have access to your Aure AD i
264282
- *aud*: should be your CLIENT_ID
265283
- *iss*: should end with 2.0. otherwise you should verify the previous step **Manifest change**
266284

267-
7.2 Verify the Client Password Token.
285+
8.2 Verify the Client Password Token.
268286

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

@@ -289,6 +307,7 @@ After activating your account by email, you should have access to your Aure AD i
289307
"iss": "https://login.microsoftonline.com/<TENANT_ID>/v2.0",
290308
...
291309
"email": "<USERNAME>",
310+
"identity": "<USERNAME>",
292311
"groups": [
293312
"<GROUP>"
294313
],
@@ -565,7 +584,7 @@ Get hands-on experience with IBM Operational Decision Manager in a container env
565584
566585
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)
567586
568-
Import the **Loan Validation Service** in Decision Center connected as John Doe
587+
Import the **Loan Validation Service** in Decision Center connected using *myodmuser*@YOURDOMAIN created at step 2
569588
570589
![Import project](/images/Keycloak/import_project.png)
571590
516 Bytes
Binary file not shown.

authentication/AzureAD/templates/openIdWebSecurity.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,5 @@
2222
issuerIdentifier="${ServerHost}/v2.0"
2323
authorizationEndpointUrl="${ServerHost}/oauth2/v2.0/authorize"
2424
tokenEndpointUrl="${ServerHost}/oauth2/v2.0/token"
25-
userIdentifier="aud" groupIdentifier="groups" audiences="ALL_AUDIENCES"/>
26-
</server>
25+
userIdentifier="identity" groupIdentifier="groups" audiences="ALL_AUDIENCES"/>
26+
</server>

0 commit comments

Comments
 (0)