mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2026-03-07 07:48:10 +01:00
Added an console command to convert local to SAML users and vice versa
This commit is contained in:
@@ -26,12 +26,14 @@ use Symfony\Component\Security\Core\User\UserInterface;
|
||||
|
||||
class SamlUserFactory implements SamlUserFactoryInterface
|
||||
{
|
||||
public const SAML_PASSWORD_PLACEHOLDER = '!!SAML!!';
|
||||
|
||||
public function createUser($username, array $attributes = []): UserInterface
|
||||
{
|
||||
$user = new User();
|
||||
$user->setName($username);
|
||||
$user->setNeedPwChange(false);
|
||||
$user->setPassword('!!SAML!!');
|
||||
$user->setPassword(self::SAML_PASSWORD_PLACEHOLDER);
|
||||
//This is a SAML user now!
|
||||
$user->setSamlUser(true);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user