Skip to content

Commit e1a729e

Browse files
committed
New changes
1 parent af09aad commit e1a729e

File tree

1 file changed

+8
-29
lines changed

1 file changed

+8
-29
lines changed

content/en/docs/appstore/use-content/platform-supported-content/modules/sap/sap-xsuaa-connector.md

Lines changed: 8 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ By default, the Mendix login page will not allow the user to enter their SSO cre
125125
* Bypass the Mendix login page altogether and just display the XSUAA login page
126126

127127
{{% alert color="info" %}}
128-
If you are using the [Deep Link](/appstore/modules/deep-link/) module, you will also need to set the **LoginLocation** constant to `/xsauaalogin/login?ret=`.
128+
The page/microflow URL is used to redirect users to the desired page. If you are using the [Deep Link](/appstore/modules/deep-link/) module, you will also need to set the **LoginLocation** constant to `/xsauaalogin/login?ret=`.
129129
{{% /alert %}}
130130

131131
#### Adding the SSO Login Button to the Login Page {#adding}
@@ -152,10 +152,12 @@ If login.html does not support XSUAA then you need to add the SSO login button t
152152
6. Replace those lines with the following lines (or add them below the `<a>` element in the code above):
153153

154154
```html
155-
<a id="ssoButton" href="/xsauaalogin/" class="btn btn-default btn-lg">
156-
<img src="logo.png" />
157-
<span class="loginpage-signin">Sign in using XSUAA</span>
158-
</a>
155+
<script>
156+
document.getElementById("ssoButton").addEventListener("click", function (event) {
157+
event.preventDefault();
158+
window.location.href = '/xsauaalogin/login?ret=' + encodeURIComponent(window.location.search + window.location.hash);
159+
});
160+
</script>
159161
```
160162

161163
7. Deploy and run your app. The XSUAA login button will look like this:
@@ -182,35 +184,12 @@ To accomplish this, follow these steps:
182184
<html>
183185
<head>
184186
<script>
185-
window.location.assign("/xsauaalogin/")
187+
self.location = '/xsauaalogin/login?ret=' + encodeURIComponent(window.location.search + window.location.hash);
186188
</script>
187189
</head>
188190
</html>
189191
```
190192

191-
#### Using Page and Microflow URLs
192-
193-
To redirect the users to the desired page using page and microflow URLs, follow the steps below:
194-
195-
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`.
196-
197-
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:
198-
199-
* For automatic redirection, you can use `window.onload` to redirect users to the SSO login page automatically. You could, for example, use the following code:
200-
201-
```javascript
202-
const returnURL = encodeURIComponent(window.location.search + window.location.hash);
203-
self.location = '/xsauaalogin/login?ret=' + returnURL;
204-
```
205-
206-
* For manual redirection, you can add an onclick event to a button that manually triggers the SSO login. For example:
207-
208-
```javascript
209-
window.location.href = '/xsauaalogin/login?ret=' + encodeURIComponent(window.location.search + window.location.hash);
210-
```
211-
212-
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.
213-
214193
### Configuring the SAP BTP Subaccount
215194

216195
Your app is configured to use an IdP. Now you need to configure the IdP and allocate users to roles. This is performed in the [SAP Business Technology Platform cockpit](https://account.hana.ondemand.com/cockpit#/home/allaccounts).

0 commit comments

Comments
 (0)