Skip to content

Commit 374a1fc

Browse files
authored
Merge pull request #9269 from mendix/kv-oidc-private-key
OIDC: private key update
2 parents f53d3a9 + e88adc5 commit 374a1fc

File tree

1 file changed

+41
-9
lines changed
  • content/en/docs/appstore/use-content/platform-supported-content/modules

1 file changed

+41
-9
lines changed

content/en/docs/appstore/use-content/platform-supported-content/modules/oidc.md

Lines changed: 41 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,8 @@ For readers with more knowledge of the OAuth and OIDC protocol:
9393
For signing into the app, the OIDC SSO module will not use token introspection and will always validate against the published `jwks` endpoint.
9494

9595
* Stores an access token for each end-user that can be used to make API calls on their behalf
96-
* Can be configured to use either client_secret_post or client_secret_basic as the client authentication method. Both make use of the client-id and client-secret as configured at the IdP
96+
* Can be configured to use either `client_secret_post`, `client_secret_basic`, or `private_key_jwt` as the client authentication method.
97+
* It supports nine signing algorithms (ES256, ES384, ES512, PS256, PS384, PS512, RS256, RS384, RS512) and automatically regenerates a new key pair upon expiry.
9798
* Supports ACR in authorization requests. The ACR in OIDC protocol is used to indicate the desired level of assurance or strength of authentication during the authentication process. It allows the relying party (your application) to request a specific level of authentication assurance from the identity provider (IdP) (version 2.3.0 and above)
9899
* Supports response_mode=query and response_mode=form_post
99100
* Helps you implement an OAuth Resource Server that receives an Access Token which is obtained by a client via either Authorization Code grant or Client Credential grant.
@@ -105,7 +106,6 @@ For readers with more knowledge of the OAuth and OIDC protocol:
105106
The OIDC SSO module does not yet support the following:
106107

107108
* Requesting claims via the 'claims' query parameter, as per OIDC specs
108-
* Other client authentication methods such as using asymmetric keys (“private_key_jwt”)
109109
* Delegating authorization using OAuth-scopes; this currently requires a custom microflow for parsing of Access Tokens
110110
* Mobile apps
111111
* Controlling the configuration using constants requires an app restart
@@ -128,6 +128,7 @@ It requires the following Marketplace modules to be included in your app:
128128
* [Nanoflow Commons](https://marketplace.mendix.com/link/component/109515) – see [Nanoflow Commons](/appstore/modules/nanoflow-commons/) documentation.
129129
* [Mx Model reflection](https://marketplace.mendix.com/link/component/69) – see [Mx Model Reflection](/appstore/modules/model-reflection/) documentation (deprecated from version 4.0.0 of the module).
130130
* [User Commons](https://marketplace.mendix.com/link/component/223053) (for version 3.0.0 and above)
131+
* [Events](https://marketplace.mendix.com/link/component/224259) – see [Events](/appstore/widgets/events/) documentation.
131132

132133
Versions below 2.3.0 also require [Native Mobile Resources](https://marketplace.mendix.com/link/component/109513) – see [Native Mobile Resources](/appstore/modules/native-mobile-resources/) documentation.
133134

@@ -315,21 +316,28 @@ In this case, the OIDC client is the app you are making.
315316

316317
**Client assertion** is automatically set to *Client ID and Secret*.
317318

318-
4. Choose the **Client authentication method** — make sure that you select a method that is supported by your IdP. You can normally check this via the `token_endpoint_auth_methods_supported` setting on the IdP’s well-known endpoint. Also ensure that the correct client authentication method is configured at the IdP when you register the client.
319+
4. Choose the **Client authentication method** — make sure that you select a method that is supported by your IdP. You can normally check this via the `token_endpoint_auth_methods_supported` setting on the IdP’s well-known endpoint. Also, ensure that the correct client authentication method is configured at the IdP when you register the client.
319320

320321
The options are:
321-
* `client_secret_basic`: Your app will use the HTTP Basic Authentication scheme to authenticate itself at your IdP. (Default – for security reasons this should be your preferred choice)
322-
* `client_secret_post`: Your app will authenticate itself by including its `client_id` and `client_secret` in the payload of token requests. (Older versions of the OIDC SSO module used this method).
322+
* `client_secret_basic`: Your app will use the HTTP Basic Authentication scheme to authenticate itself at your IdP. This is the default. The `client_secret_basic` makes use of the `client-id` and `client-secret`.
323+
* `client_secret_post`: Your app will authenticate itself by including its `client_id` and `client_secret` in the payload of token requests. (Older versions of the OIDC SSO module used this method.)
324+
* `private_key_jwt`: This method, introduced in version 4.1.0, uses asymmetric key cryptography (algorithm) for authentication. This is the best option for security. When you select the `private key` option, you can configure the following fields:
325+
* **Key Pair Expiration Days**: (default `90`)
326+
* **JWT ALG(Signing Algorithm)**: (default `RS256`)
327+
328+
Once you **Save** the configuration, a key pair is automatically generated. Before you set up the private key authentication in your Mendix App, complete the JWKS configuration at your IdP. Check the documentation of your IdP for details. If you are using Okta, you can refer to the [Configuring JWKS at Your IdP (Okta)](#jwks-okta) section.
329+
330+
{{% alert color="info" %}}After a key renewal, some SSO requests may fail if your IdP does not immediately refresh its key cache. {{% /alert %}}
323331

324332
5. Add the **Client Secret**.
325333
6. If you have the **Automatic Configuration URL** (also known as the *well-known endpoint*), enter it and click **Import Configuration** to automatically fill the other endpoints.
326334

327-
{{% alert color="info" %}}If the endpoint URL does not already end with `/.well-known/openid-configuration`, include it at the end. According to the specifications, the URL you need to enter typically ends with `/.well-known/openid-configuration`.{{% /alert %}}
335+
{{% alert color="info" %}} If the endpoint URL does not already end with `/.well-known/openid-configuration`, include it at the end. According to the specifications, the URL you need to enter typically ends with `/.well-known/openid-configuration`. {{% /alert %}}
328336

329337
* If you do not have an automatic configuration URL, you can fill in the other endpoints manually.
330338
7. Click **Save**
331339

332-
{{% alert color="info" %}}Your client configuration is not yet complete, but you have to save at this point to allow you to set up the rest of the information.{{% /alert %}}
340+
{{% alert color="info" %}} Your client configuration is not yet complete, but you have to save at this point to allow you to set up the rest of the information. {{% /alert %}}
333341

334342
8. Select your client configuration and click **Edit**.
335343
9. Select the scopes expected by your OIDC IdP. The standard scopes are `openid`, `profile`, and `email`, but some IdPs may use different ones.
@@ -383,7 +391,7 @@ Now, you can acquire tokens which can be validated using JWKS URI.
383391

384392
For more information about configuring your app for OIDC with Amazon Cognito, see [Amazon Cognito: Configuring the Required Settings in Your Mendix App](/appstore/modules/aws/amazon-cognito/#cognito).
385393

386-
### Deploytime Configuration of Your IdP at Your App{#deploytime-idp-configuration}
394+
### Deploy-time Configuration of Your IdP at Your App{#deploytime-idp-configuration}
387395

388396
#### Automated Deploy-time SSO Configuration{#deploy-time}
389397

@@ -434,7 +442,19 @@ The following constants are optional:
434442

435443
* **ClientAuthenticationMethod** (*default: client_secret_basic*) – the client authentication method — the caption of OIDC.ENU_ClientAuthenticationMethod
436444

437-
Examples: `client_secret_post` or `client_secret_basic`
445+
Examples: `client_secret_post`, `client_secret_basic`, or `private_key_jwt`
446+
447+
{{% alert color="info" %}}
448+
when you set **ClientAuthenticationMethod** as `private_key_jwt`, you do not need to set **ClientSecret** constant.
449+
{{% /alert %}}
450+
451+
* **JWT_ALG** (*default: RS256*) – JWT signing algorithm
452+
453+
Example: `ES256`, `ES384`, `ES512`, `PS256`, `PS384`, `PS512`, `RS256`,`RS384`, and `RS512`
454+
455+
* **KeyPair_ExpirationDays** (*default: 90*) – Expiration time of key pair
456+
457+
Example: `30`
438458

439459
* **CallbackResponseMode** (*default: Query*) – : the callback response mode — the caption of OIDC.ENU_ResponseMode
440460

@@ -1005,6 +1025,18 @@ Your IdP may have different ways of handling requests to use a specific authenti
10051025

10061026
When a user successfully signs in at your IdP, your IdP may or may not return an ACR claim in the ID-token. If your IdP returns the actual authentication method that was used in the ACR claim in the ID-token (and/or Access Token), you can create a [custom User Provisioning microflow](#microflow-at-runtime) (or [custom access token parsing microflow](#custom-parsing)) to grant or restrict access to specific resources or functionalities based on the level of authentication assurance.
10071027

1028+
### Configuring JWKS at Your IdP (Okta) {#jwks-okta}
1029+
1030+
Follow the steps below to configure the JWKS in Okta before you set up the private key
1031+
authentication in your Mendix App.
1032+
1033+
1. Go to the OIDC application in Okta.
1034+
2. Navigate to the **General** tab and click **Edit** in the Client Credentials section.
1035+
3. For **Client authentication**, select **Public Key / Private Key**.
1036+
4. In the **PUBLIC KEYS** section, go to the **Configuration** and choose **Use a URL to fetch keys dynamically**.
1037+
5. In the **Url** field, enter the location where your public key is stored. The following is the new endpoint in the OIDC SSO to fetch public keys based on the configured alias For example, `https:/`*`BASE_URL`*`/oauth/v2/jwks/`*`ALIAS`*. Here, *`ALIAS`* is the client alias configured in the OIDC application. For example, Okta.
1038+
6. **Save** the configuration.
1039+
10081040
## Testing and Troubleshooting{#testing}
10091041

10101042
Once you have your app deployed, you can test the SSO set-up by trying to login. If you have multiple IdPs set up, you will be able to choose which IdP to use for authentication. If you have only one IdP provider configured, then you will be taken directly to that IdP's sign in page.

0 commit comments

Comments
 (0)