SAML SSO gives us a error

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

SAML SSO gives us a error

Post by jeelman »

We use Microsoft as SAML provider, this is working fine.

After we login Debug mode gives us the following error:

UserProfile::setUserName(): Argument #1 ($value) must be of type string, null given, called in \src\AdvancedSecurity.php on line 590

Any idea's what we are doing wrong?
Thx for the support.


arbei
User
Posts: 9424

Post by arbei »

After login, the user name will be saved to the user profile object. The user name is that you use to login SAML IdP or the email returned by it. The user name should not be null if you can login the Idp. In addition, make sure your user profiles on the SAML IdP has email address and you set up Claims and Attributes returning "user.email" as one of the claims (e.g. as "emailaddress" or "email").


jeelman
User
Posts: 2

Post by jeelman »

thx for your response:

Email address is avbl in the response:

 <Attribute Name="http://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress">
    <AttributeValue>JXXXXXXXX@XXXXXXXXX.com</AttributeValue>
   </Attribute>

arbei
User
Posts: 9424

Post by arbei »

Then the email address will be set up in the user profile as the "email" property, and the error should not occur since the source code is like:

// src/AdvancedSecurity.php

                    $profile = $adapter->getUserProfile(); // Hybridauth\User\Profile
                    $usr = $usr ?: $profile->email; // If user is null, email from profile will be used.
                    $userProfile->setUserName($usr) ...

You may add some code to debug, e.g. Log($profile); Log($usr); and check your log file.


Post Reply