Allow X500 attributes for user info and added some tests

This commit is contained in:
Jan Böhmer 2023-02-21 23:41:02 +01:00
parent 91fb861fd3
commit 586a57c2c9
7 changed files with 193 additions and 3 deletions

View file

@ -44,7 +44,7 @@ class EnsureSAMLUserForSAMLLoginChecker implements EventSubscriberInterface
];
}
public function onAuthenticationSuccess(AuthenticationSuccessEvent $event)
public function onAuthenticationSuccess(AuthenticationSuccessEvent $event): void
{
$token = $event->getAuthenticationToken();
$user = $token->getUser();

View file

@ -31,13 +31,12 @@ class SamlUserFactory implements SamlUserFactoryInterface
$user = new User();
$user->setName($username);
$user->setNeedPwChange(false);
$user->setPassword('$$SAML$$');
$user->setPassword('!!SAML!!');
//This is a SAML user now!
$user->setSamlUser(true);
$user->setSamlAttributes($attributes);
return $user;
}
}