Don't use username+password to get tokens from MS Graph (ROPC).Instead, implement OAuth2 / OIDC Authorization Code flow (with PKCE) in a popup and force a re-authentication/step-up via the authorize endpoint (e.g. prompt=login / OIDC step-up). Validate the returned ID/access token server-side (check oid/sub/email, iat/exp, token signature). If additional assurance is required use Azure Conditional Access (MFA/step-up) or require claims/acr_values.
Force Re-authentication Follow
When user clicks “Approve”, open an OAuth authorize request in a small popup window (not a full login form embedded in your page). Use parameters to force a fresh login / step-up. That causes the IdP to show the login prompt or trigger MFA/conditional access.
After successful authentication, the IdP returns tokens (or a code you exchange) to your app/backend. Validate tokens and confirm the user identity matches the currently logged-in user.
Note:Do the exchange server-side (Mendix microflow / REST call) using the confidential client credentials. This avoids exposing client secret in the browser and allows secure token validation and logging.
I hope this help's you