mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-06-26 11:48:49 +02:00
Added an console command to convert local to SAML users and vice versa
This commit is contained in:
parent
c5904303e3
commit
c831d57614
5 changed files with 165 additions and 4 deletions
|
@ -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);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue