Skip to content
Snippets Groups Projects
Commit 1526613d authored by Guillaume ROUSSE's avatar Guillaume ROUSSE
Browse files

fix account creation

parent fee7b6d2
No related branches found
No related tags found
No related merge requests found
......@@ -100,15 +100,19 @@ sub add_account {
my $validity_period =
$configuration->{$entity}->{account_validity_period} ||
$configuration->{service}->{account_validity_period};
my $password = AccessCheck::Tools::generate_password();
my $password = AccessCheck::Tools::generate_password(10);
my $key = AccessCheck::Tools::generate_secret(10);
my $secret = AccessCheck::Tools::generate_secret(20);
my $account = AccessCheck::Data::Account->new(
db => $db,
profile => $options{profile},
entityid => $options{entityid},
entityid => $options{entityid},
scope => $configuration->{idp}->{scope},
password => $password,
password_crypt => AccessCheck::Tools::encrypt($password, $key),
password_hash => AccessCheck::Tools::sha256_hash($password),
token => $secret,
creation_date => DateTime->now(),
expiration_date => DateTime->now()->add(days => $validity_period)
);
......@@ -158,7 +162,7 @@ sub list_accounts {
try {
AccessCheck::Tools::update_ssp_authsources(
$configuration->{setup}->{templates_dir},
curfile()->dirname()->sibling('templates'),
$configuration->{setup}->{accounts_file},
$accounts
);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment