Skip to content

Commit f53d3a9

Browse files
authored
Merge pull request #9299 from mendix/kv-OIDC-page-url
OIDC SSO: page URL updates
2 parents a2473f2 + 07425d4 commit f53d3a9

File tree

1 file changed

+29
-14
lines changed
  • content/en/docs/appstore/use-content/platform-supported-content/modules

1 file changed

+29
-14
lines changed

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

Lines changed: 29 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -783,6 +783,7 @@ If you are just delegating authentication for your app to the IdP you will not n
783783
If you want to use the information in an access token which is a JWT, you need to parse the access token in a microflow. For example, you may want to assign user roles in your app based on the contents of the access token JWT.
784784

785785
* The OIDC module provides you with default microflows for parsing access tokens from the following IdPs:
786+
786787
* Siemens SAM – in this case the `sws.samauth.role.name` claim is interpreted — for example:
787788

788789
```json
@@ -799,7 +800,7 @@ If you want to use the information in an access token which is a JWT, you need t
799800
]
800801
```
801802

802-
* If you are using another IdP or want to use a different claim, you can create a custom microflow to parse the access token.
803+
If you are using another IdP or want to use a different claim, you can create a custom microflow to parse the access token.
803804

804805
To parse access tokens, you need to do the following:
805806

@@ -900,28 +901,42 @@ For more information on using Deep Link module (with Mendix 8 and 9), see the [U
900901
Page URLs and Microflow URLs are supported with OIDC SSO for Mendix version 10.6 and above. To do this, follow the steps below:
901902

902903
1. In the **Runtime** tab of the **App Settings**, configure the page **URL prefix** to **link** instead of the default **P** to maintain compatibility with existing URLs, and ensure to remove the Deep Link module from your app to start the app successfully.
903-
1. Configure **OIDC.Login_Web_Button** as the **Sign-in page** in the **Authentication** section of the app **Navigation**.
904-
1. The user is redirected to the OIDC login page for authentication.
905-
1. After successful log in, the user is directed to the desired page using page URLs and microflow URLs within the application.
904+
2. Configure **OIDC.Login_Web_Button** as the **Sign-in page** in the **Authentication** section of the app **Navigation**.
905+
3. The user is redirected to the OIDC login page for authentication.
906+
4. After successful log in, the user is directed to the desired page using page URLs and microflow URLs within the application.
906907

907908
If you are building a new app using the OIDC SSO module (Mendix version 10.6 and above) and you are using Page URLs and Microflow URLs, follow the same steps as above.
908909

909-
To allow the end users to navigate to the desired page:
910+
The Page and Microflow URLs fully support multiple IdPs, allowing users to trigger the login and choose the IdP on the OIDC login page.
911+
For more information, see the [Migrating to Page and Microflow URLs](/appstore/modules/deep-link/#migrate-page-micro) section of the *Deep Link*.
910912

911-
* If single IdP configured, URL will be the base URL of your application followed by `oauth/v2/login?cont={page/Microflowurl}`
913+
Starting from Studio Pro 10.9.0, you can use the primitive parameters as **Query string** parameters in microflows. Check the checkbox in the parameter table to configure a microflow parameter to use as a **Query string** parameter.
914+
For more information, see the [URL](/refguide/microflow/#url) section of the *Microflow Properties*.
912915

913-
For example, `http://localhost:8080/oauth/v2/login?cont=link/pagepath`
916+
##### Steps for OIDC SSO Version v4.1.0 and above
914917

915-
* If multiple IdPs configured, you can specify which IdP should be used by adding the alias (MyIdPAlias)
916-
`oauth/v2/login?idp={MyIdPAlias}&cont={page/Microflowurl}`
918+
In OIDC SSO version 4.1.0 and above, you do not have to enable anonymous users.
917919

918-
For example, `http://localhost:8080/oauth/v2/login?idp=Okta&cont=link/pagepath`
920+
You can disable this setting by navigating to **Security > Anonymous users** and setting **Allow anonymous users** to **No**.
919921

920-
The Page and Microflow URLs fully support multiple IdPs, allowing users to trigger the login and choose the IdP on the OIDC login page.
921-
For more information, see the [Migrating to Page and Microflow URLs](/appstore/modules/deep-link/#migrate-page-micro) section of the *Deep Link*.
922+
1. To use the Page URL functionality, replace the content of `login.html` with the content of `login-with-mendixsso-automatically.html` (located in the `resources\mendixsso\templates` folder) and save it as `login.html`.
922923

923-
Starting from Studio Pro 10.9.0, you can use the primitive parameters as **Query string** parameters in microflows. Check the checkbox in the parameter table to configure a microflow parameter to use as a **Query string** parameter.
924-
For more information, see the [URL](/refguide/microflow/#url) section of the *Microflow Properties*.
924+
2. To implement the SSO redirection, you will need to replace the code in the `<script>` tag of your login page (for example, `login.html`) with code which does one of the following, depending on whether you want automatic or manual redirection:
925+
926+
* For automatic redirection, you can use `window.onload` to automatically redirect users to the SSO login page. You could, for example, use the following code:
927+
928+
```javascript
929+
const returnURL = encodeURIComponent(window.location.search+window.location.hash);
930+
self.location = '/oauth/v2/login?cont='+returnURL;
931+
```
932+
933+
* For manual redirection, you can add an onclick event to a button that manually triggers the SSO login. For example:
934+
935+
```javascript
936+
window.location.href='/oauth/v2/login?cont=' + encodeURIComponent(window.location.search + window.location.hash);
937+
```
938+
939+
Once the above changes are applied, end users can directly navigate to the desired page. If not logged in, they will be redirected to the IdP login page for authentication. After successful log in, they will be directed to the desired page using page and microflow URLs.
925940

926941
#### Using Deep Link Module{#using-deep-link}
927942

0 commit comments

Comments
 (0)