The SAP XSUAA Connector enables the use of an external identity provider (IDP) on a Mendix application so that a user can have a single sign-on (SSO) experience on their application.
This how-to will teach you how to do the following:
- Add the XSUAA Connector to your project
- Configure the XSUAA connector
Before starting this how-to, make sure you have completed the following prerequisites:
- Create the app in the Mendix Desktop Modeler 7.5.1 or higher
- Get the SAP OData Connector module
2.1 Getting the SAP XSUAA Connector Module
To be able to use the SAP XSUAA Connector, after creating your project, navigate to the Mendix App Store to download the SAP XSUAA Connector module. You will then find this module in your app project’s App Store modules.
For more information, see How to Use App Store Content in the Modeler.
3 Using the Connector
In this section, you will learn how to implement the data connector in your Mendix app.
3.1 Adding the OnStartup Microflow to the Application Settings
To add the OnStartup microflow to your application settings, follow these steps:
- In the Project Explorer, select Project > Settings and open the Runtime tab.
- For the AfterStartup microflow, select the OnStartup microflow:
To add the SSO login button to the landing page, follow these steps:
- In the top menu of the Desktop Modeler, select Project > Show Project Directory in Explorer.
- Open the theme folder.
- Open login.html:
Locate this line:
Below the line above, add this line:
<a id="ssoButton" href="/xsauaalogin/" class="login-sso-button btn btn-primary">Sign in with your XSUAA account</a>
The XSUAA login button will look like this:
3.3 Redirecting Your Application to XSUAA Without Showing the Login Page (Alternative Method)
An alternative to adding the SSO login button to the landing page of your app is to redirect your app to XSUAA automatically without showing the login page. To accomplish this, follow these steps:
- Open the project directory of your project and then open the theme folder.
Change the contents of login.html into the following:
<!doctype html> <html> <head> <script> window.location.assign("/xsauaalogin/") </script> </head> </html>