SAML: An unexpected error occoured when creating a session

0
Hi everyone. I configured SAML for users external to my company. When they try to access for the first, time they get this error:  An unexpected error occured while creating a session   This error occours only the first time. If they press "Try Again", they succesfully login. This is the SAML error log:  Could not create a session for the provided user principal '<user email>': Cannot invoke "com.mendix.systemwideinterfaces.core.IUser.isActive()" because the return value of "saml20.implementation.security.SAMLSessionInfo.getIUser()" is null Can someone help me understand the cause of this error? I'm using SAML version 3.6.7 on Studio Pro 10.21.1
asked
1 answers
0

The error occurs because the Mendix user doesn’t exist yet when SAML tries to create a session. Specifically, getIUser() returns null, so calling isActive() on it causes the crash.

Reason of Occurence:

  • On first login, the user isn't created yet.

  • The SAML module tries to use the user object too early.

  • On retry, the user is already created, so it works.

Way to Fix:

  1. Enable "Create Mendix user if it doesn’t exist" in SAML configuration.

  2. Check your ProcessAssertion or AfterLogin microflows – make sure you’re not calling getIUser().isActive() before the user is provisioned.

  3. Use latest SAML version if possible (3.6.8+ may fix this internally).

 Refence Link : https://docs.mendix.com/appstore/modules/saml/

answered