You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/en/docs/appstore/modules/oidc-provider.md
+58-9Lines changed: 58 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -37,8 +37,9 @@ The OIDC Provider has the following features and limitations:
37
37
38
38
**Features**
39
39
40
-
* allows for registration of Mendix apps via the client registration endpoint
41
-
* works/integrates with the platform-supported [OIDC SSO](/appstore/modules/oidc/) module
40
+
* It allows for registration of Mendix apps via the client registration endpoint.
41
+
* It works/integrates with the platform-supported [OIDC SSO](/appstore/modules/oidc/) module.
42
+
* It provides a standard mechanism to communicate which user roles are assigned for the end-user in connected Mendix apps.
42
43
* It supports responsive web applications, using the common OAuth Authorization Code grant.
43
44
* Your apps can be registered as an OIDC client with the OIDC Provider using the client registration API or client configuration screen. The client registration API allows you to register your client automatically when using a CI/CD deployment pipeline.
44
45
* It publishes a well-known endpoint to communicate endpoints and other IdP characteristics to client applications. Mendix apps using the OIDC SSO module will consume this endpoint to perform actions like retrieving the keys needed to validate ID-tokens that they receive.
@@ -201,7 +202,7 @@ Choose one of the two options, below.
201
202
202
203
Whichever option you choose, you will need to use [Custom User Provisioning](/appstore/modules/oidc/#custom-provisioning) in the OIDC SSO module of your client app to assign the correct user roles to the end-user.
203
204
204
-
##### 3.3.3.1 Configuration of the OIDC Provider for Centralized Authorization with Scopes
205
+
##### 3.3.3.1 Configuration of the OIDC Provider for Centralized Authorization with Scopes{#configure-scopes}
205
206
206
207
When you follow the recommended approach for [centralized authorization](#centralized-auth) using OAuth scopes, the OIDC Provider needs to know which user roles have been implemented in your Mendix apps, so the client can assign those user roles.
207
208
@@ -210,11 +211,17 @@ The scope values (user roles) that you assign to the authenticated user in the O
210
211
To return requested scopes to your client app, you need to perform the following steps to configure the OIDC Provider:
211
212
212
213
1. Open the **Scopes** tab for the client you want to configure
213
-
1. Create a new scope for every user role which is implemented in your client apps. This scope has the same **Name** as the user role in your client app.
214
+
1. Create a new scope for every user role which is implemented in your client apps. You can identify the user role in one of two ways:
215
+
216
+
1. use the **Name** as the user role in your client app.
217
+
1. From version 1.1.0 you can also use the UUID of the user role in your client app.
218
+
219
+
The benefit of this second approach is that it avoids ‘scope collision’. In other words, you avoid having confusion between user roles with the same name but in different apps.
214
220
215
221
If your client app consumes APIs and wants to get access using the Access Token from the OIDC Provider, you may want to configure additional scope values, as required by those APIs.
216
222
217
223
{{% alert color="warning" %}}
224
+
218
225
Do not to create scopes with the same name as standard scopes (as defined in the [OIDC specs](https://openid.net/specs/openid-connect-core-1_0.html#ScopeClaims)), for example:
219
226
220
227
* openid - apps will use this scope value to request identity propagation from the OIDC Provider by means of an ID-token.
@@ -224,7 +231,7 @@ Do not to create scopes with the same name as standard scopes (as defined in the
224
231
{{% /alert %}}
225
232
226
233
{{% alert color="info" %}}
227
-
The scopes you configure are not added automatically to the “scopes_supported” attribute on the OIDC Provider’s well-known endpoint. You must manually configure the scope value in your client app to be able to request it.
234
+
The scopes you configure are not added automatically to the "scopes_supported" attribute on the OIDC Provider’s well-known endpoint. You must manually configure the scope value in your client app to be able to request it.
228
235
{{% /alert %}}
229
236
230
237
1. Add logic to the OIDC Provider to assign user roles (custom scope values) based on your preferred business logic.
@@ -240,13 +247,35 @@ The scopes you configure are not added automatically to the “scopes_supported
240
247
241
248
{{% alert color="info" %}}The default implementation of `OpenIDConnectProvider.SUB_CustomScope` grants any requested scope provided it is associated with client (your Mendix app). It does not do any validation of the end user.{{% /alert %}}
242
249
250
+
1. In the connected apps, select the following microflows in the [OIDC SSO](/appstore/modules/oidc/) module to let you app apply the assigned user roles to the end-users:
251
+
252
+
* `UserProvisioning_StandardOIDC` as the user provisioning microflow
253
+
254
+
This is available in version 2.3.0 and above of the OIDC SSO module. For versions below this, you will need to write a custom user provisioning microflow.
255
+
256
+
* `OIDC.Default_OIDCProvider_TokenProcessing_CustomATP` as the **custom AccessToken processing microflow** for access token parsing
257
+
243
258
##### 3.3.3.2 Configuration of the OIDC Provider to Propagate the End-User’s Identity with Custom Claims{#propagate-custom-claims}
244
259
245
260
Typically you want to propagate the end-user’s identity from the OIDC Provider to your Mendix app. Although the basic user attributes like ‘email address’ and ‘user name’ may be sufficient, your app may need more information about the end-user. User attributes like ‘department’ or ‘job-title’ may be used for business logic, including decentralized authorization.
246
261
247
262
To pass this additional information, you need to create custom claims. You can do this as follows:
248
263
249
264
1. Create a microflow which returns a value to the claim.
265
+
266
+
From version 1.1.0, you can also pass an object from the Domain Model as the custom claim in an ID-token. To do this, your microflow should return the object.
267
+
268
+
The ID-token will be a nested JSON structure with the name of the object as the key and a list of attribute names of your object as the keys and the attribute values as the values.
"MyObjectName"will be used as the claim name. See note about how to name custom claims in the [Propagate Custom Claims](#propagate-custom-claims) section, above.
278
+
250
279
1. Run (publish) your app.
251
280
1. Sign in to your app as an Administrator.
252
281
1. Open the **Mx Objects** overview page and synchronize the required modules to see the new microflow.
@@ -342,26 +371,35 @@ The format of non-custom claims in the ID-token is as follows:
In versions of OIDC Provider below 1.1.0, the following values are not included in the ID-token claim:
398
+
399
+
* "email"
400
+
* "name"
401
+
* "username"
402
+
365
403
## 6 Troubleshooting
366
404
367
405
### 6.1 Infinite Loop of Redirects
@@ -405,7 +443,7 @@ Using OAuth scopes is the recommended approach since it is the standard OAuth so
405
443
406
444
Since the OIDC Provider issues access tokens for end-users that are logged in, it needs to record end-users as objects in the app which contains the OIDC Provider module.
407
445
408
-
The OIDC Provider module adds the `AccountDetail` entity into your Provider app. It uses the `MendixUserID` attribute of `AccountDetail` to populate the “sub” claim in the access token. For any other user claims you want to include in your access token, you need to create a microflow as described in [Configuration of the OIDC Provider to Propagate the End-User’s Identity with Custom Claims](#propagate-custom-claims), above.
446
+
The OIDC Provider module adds the `AccountDetail` entity into your Provider app. It uses the `MendixUserID` attribute of `AccountDetail` to populate the "sub" claim in the access token. For any other user claims you want to include in your access token, you need to create a microflow as described in [Configuration of the OIDC Provider to Propagate the End-User’s Identity with Custom Claims](#propagate-custom-claims), above.
409
447
410
448
There are two ways in OIDC Provider to get create accounts:
411
449
@@ -420,3 +458,14 @@ This means that the access token will contain a "sub" claim which gets value fro
420
458
This is the case where the OIDC Provider module can be used separately as an IDP without building an IAM structure.
421
459
422
460
Where there is no IAM brokering functionality, the administrator can create end-users (Accounts) using the AccountDetail page in the OIDC Provider module. This page creates `AccountDetail` objects which automatically create `Account` objects in the app to represent the AccountDetails as accounts.
461
+
462
+
### 7.4 Structure of ID and Access Tokens
463
+
464
+
For situations where the Centralized Authorization concept is used (see [Centralized Authorization](#centralized-auth), above), the OIDC Provider module uses the ‘scope’ claim in both the ID and Access token to communicate assigned user roles to connected Mendix apps. The scope parameter one of the following the formats:
465
+
466
+
*`mx:app:userrole:{user-role-UUID}`, where `{user-role-UUID}` is the UUID of the role in the connected app (version 1.1.0 and above)
467
+
*`{user-role}`, where `{user-role}` is the name of the user role
468
+
469
+
These are set up in [Configuration of the OIDC Provider for Centralized Authorization with Scopes](#configure-scopes). Multiple scopes will be separated by spaces.
470
+
471
+
For example: `mx:app:userrole:53f5d6fa-6da9-4a71-b011-454ec052cce8 mx:app:userrole:6c5ea333-799c-4438-96fc-2528ced788e4`
0 commit comments