You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, I'm using laravel-saml2 and encountering a case-sensitive email issue where the email returned by the Identity Provider does not match the case of the email stored in our database, causing login failures. Is there a way to configure the package to handle email case insensitivity or any suggestions to fix this? Thanks!
The text was updated successfully, but these errors were encountered:
You can achieve this by changing the case of the email address returned by the IDP when you handle the SignedIn event.
Within the listener that subscribed to the SignedIn event, you can change the case of the email address before retrieving the user from the database. For example:
public function handle(SignedIn $event)
{
// Get the returned user from the IDP
$samlUser = $event->getSaml2User();
// Convert to lowercase
$email = strtolower($samlUser->getUserId());
// Get user from DB
$user = User::where('email', $email)->first();
// Log the user in
Auth::login($user);
}
Hi, I'm using laravel-saml2 and encountering a case-sensitive email issue where the email returned by the Identity Provider does not match the case of the email stored in our database, causing login failures. Is there a way to configure the package to handle email case insensitivity or any suggestions to fix this? Thanks!
The text was updated successfully, but these errors were encountered: