You can’t redirect to a Mendix page when you get AADSTS50105, because that error is raised by Entra ID (Azure AD) before it redirects back to your app. Your Mendix app (and the OIDC callback) is never reached, so Mendix cannot intercept it and send the user to /p/request-access.
Use the OIDC SSO module’s custom Access Token processing to check group/role claims and decide what Mendix user roles to grant (or deny).
hi,
his requirement cannot be implemented from the Mendix side when the error AADSTS50105 (User Not Assigned) occurs.
The reason is that this error is generated by Azure Active Directory before the authentication process is completed. When Azure AD is configured with User assignment required = Yes, Azure validates whether the user is assigned to the Enterprise Application before sending any SAML response back to Mendix.
If the user is not assigned, Azure AD blocks the authentication and displays the error page directly.
At this stage:
Therefore, Mendix cannot redirect the user to a custom page such as /p/request-access.
The handling must be moved either to Azure AD configuration or to post-login authorization inside Mendix.
Allow users to authenticate first and control access within Mendix.
In Azure Portal:
User assignment required = No
This allows Azure AD to complete authentication for all users.
After successful login, authorization can be handled inside Mendix.
Use the After Sign-In microflow configured in the Mendix SAML module.
In this microflow:
/p/request-access.This approach follows the standard enterprise SSO pattern where:
Authentication → handled by Azure AD
Authorization → handled by Mendix
It is not possible to:
Because the request never reaches the Mendix application.
The behavior is expected and by design in Azure AD SAML authentication.
To display a custom Mendix access-request page, users must first be allowed to authenticate successfully, after which access control should be implemented within Mendix using the SAML After Sign-In logic.