Custom Error Message for SAML login (v2023)

This public forum is for user-to-user discussions of PHPMaker. Note that this is not support forum.
Post Reply
rvanore
User
Posts: 39

Custom Error Message for SAML login (v2023)

Post by rvanore »

We are using PHPMaker 2023, and we would like to be able to provide an error message to the user when they succeed the SAML flow but no matching account is found in our database. From what we can see, it bypasses the User_LoggingIn() function. We were looking into setting a failure message in UserValidated() if the parameter $rs is null, but it appears this isn't the same as setFailureMessage() in User_LoggingIn(). Is there a way to call a similar function to present an error on-screen during UserValidated()?

For context, we are using Azure AD/Microsoft Entra as our IdP, and we are aware that we can limit the assigned users in this portal, but it would be preferred to let all users attempt to sign in with SAML SSO and have the application present the user with an error message if there is no matching local account. We confirmed that users are able to sign in successfully both with local credentials and with SAML; just want to be able to provide a custom support message if they encounter the above error.

Thanks in advance.


arbei
User
Posts: 9384

Post by arbei »

You may try to throw a PHP Exception in the server event.


rvanore
User
Posts: 39

Post by rvanore »

This worked! Thank you.


Post Reply