Mendix Studio Pro
This guide walks you through setting up a Mendix web application that authenticates users via your EMT environment using OpenID Connect (OIDC) Single Sign-On. We provide a ready-to-use starter template with all the OIDC plumbing pre-configured. Clone it, drop in your credentials, and you have a working authenticated Mendix app. View the starter template on Bitbucket
Mendix × EMT Starter
A ready-to-use Mendix web application starter that integrates with Enable My Team (EMT) via OpenID Connect (OIDC), so you can hit the ground running with authenticated access to your EMT environment.
What Is This?
This repository is a Mendix project starter template pre-configured to authenticate users through your Enable My Team (EMT) SaaS platform using the Mendix OIDC SSO module.
Instead of spending hours wiring up OAuth flows and configuring the OIDC module, this starter has all of that done for you. Clone it, drop in your EMT client credentials, and you have a working authenticated Mendix app.
What's included
- Simple web app which allows you to view contracts, assets, asset types and it also supports creating assets.
- Mendix project with the OIDC SSO module pre-installed and configured
- EMT-compatible OIDC flow (Authorization Code + PKCE)
- Post-login landing page as a starting point for your app
Prerequisites
Before you begin, make sure you have:
- Mendix Studio Pro *11.9.0 installed
- A running Enable My Team (EMT) tenant
- An OIDC client application registered in EMT (see below)
- Git installed locally
Getting Started
1. Clone the repository
git clone https://bitbucket.org/enablemyteam/emt_mendix_web_app_starter.git
cd emt_mendix_web_app_starter2. Register an OIDC client in EMT
Contact us at [email protected], so that we can setup an application registration for you. Please let us know if you need to have app registration in the staging environment or in the production environment. We will provide you with ClientID and ClientSecret required in the configuration below.
3. Open the project in Mendix Studio Pro
Open the .mpr file from the cloned repository in Mendix Studio Pro.
4. Configure constants
In Studio Pro, navigate to App Explorer → App TestApp1 → Settings → Configurations → default → Constants and set the following constants:
| Constant | Value |
|---|---|
EMTBaseUrl | Your EMT's project URL |
OIDC.ClientAlias | Display name of the configuration (e.g. "EMT ATLAS AIMS STAGING") |
OIDC.ClientID | Your EMT Client ID |
OIDC.ClientSecret | Your EMT Client Secret |
OIDC.AutomaticConfigurationURL | If your EMT's project URL starts with "staging-" set it to https://stagingaimsenablemyteam.b2clogin.com/StagingAimsEnableMyTeam.onmicrosoft.com/v2.0/.well-known/openid-configuration?p=B2C_1A_COMMONSIGNIN Otherwise set it to https://prodaimsenablemyteam.b2clogin.com/ProdAimsEnableMyTeam.onmicrosoft.com/v2.0/.well-known/openid-configuration?p=B2C_1A_COMMONSIGNIN |
OIDC.SelectedScope | If your EMT's project URL starts with "staging-" set it to openid offline_access https://StagingAimsEnableMyTeam.onmicrosoft.com/Rails/ReadWrite.All Otherwise set it to openid offline_access https://ProdAimsEnableMyTeam.onmicrosoft.com/Rails/ReadWrite.All |
OIDC.EncryptionKey | Set it a cryptographically secure random string 32-character value (e.g. output of the following command openssl rand -hex 16) |
6. Run the app
Press F5 (or click Run Locally) in Studio Pro to start the application locally.
7. Use the app
Step 1 — Log in
Once the app opens in your browser, the main page displays a Login to EMT button. Click it and sign in with your EMT credentials. After a successful login you will be redirected back to the app's home page.
Step 2 — Select a contract
After logging in you will see a list of contracts available to your account. Click the checkbox next to a contract name to select it.
Step 3 — Select an asset type
Once a contract is selected, the page shows the list of assets and asset types associated with that contract. Click on an asset type to select it — this loads the attribute list defined for that asset type.
Step 4 — Create a new asset
With an asset type selected, an option to create a new asset becomes available. Fill in the required attribute values and submit the form to create the asset under the chosen contract and asset type.
Step 5 — View newly created asset
After successfully creating an asset, a popup should appear displaying the id of the newly created asset. You can copy that id to verify the asset was created. In order to verify that, go back to the list of assets and navigate to the last page. Use Ctrl+F and paste the copied id into the search bar so that you can find the newly created asset.
How Authentication Works
User visits app
│
▼
Login page ──────────────► EMT OIDC Authorization Endpoint
│
User logs in with EMT credentials
│
▼
EMT redirects back with auth code
│
▼
Mendix OIDC module exchanges code for tokens
│
▼
User claims mapped to Mendix user object
│
▼
User lands on home page
The OIDC module handles token validation, refresh, and session management automatically.
Contributing
Pull requests are welcome. For significant changes, please open an issue first to discuss what you'd like to change.
License
Built with Mendix · Powered by Enable My Team
Updated about 9 hours ago