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

fix token and service creation

parent 1526613d
No related branches found
No related tags found
No related merge requests found
......@@ -218,13 +218,14 @@ sub add_service {
$options{entityid};
$provider->contacts($options{contacts});
$provider->displayname($options{displayname}) if $options{displayname};
$provider->display_name($options{displayname}) if $options{displayname};
} else {
$provider = AccessCheck::Data::Entity->new(
db => $db,
entityid => $options{entityid},
contacts => $options{contacts},
displayname => $options{displayname}
db => $db,
type => 'sp',
entityid => $options{entityid},
contacts => $options{contacts},
display_name => $options{displayname}
);
}
......@@ -325,7 +326,7 @@ sub add_token {
my $old_token = AccessCheck::Data::Token->new(
db => $db,
email_address => $options{email_address},
entityid => $options{entityid}
entityid => $options{entityid}
);
if ($old_token->load(speculative => 1)) {
......@@ -337,15 +338,15 @@ sub add_token {
my $token = AccessCheck::Data::Token->new(
db => $db,
email_address => $options{email_address},
entityid => $options{entityid},
entityid => $options{entityid},
creation_date => DateTime->now(),
expiration_date => DateTime->now()->add(hours => $validity_period),
token => AccessCheck::Tools::generate_token()
secret => AccessCheck::Tools::generate_secret(20)
);
$token->save() or die "failed to save authentication token\n";
printf "Authentication token created:\n\token %s\n", $token->token();
printf "Authentication token created:\n\token %s\n", $token->secret();
}
......
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