Skip to content
Snippets Groups Projects
Commit f61cdb1e authored by renater.salaun's avatar renater.salaun
Browse files

Added code to remove expired tokens

git-svn-id: https://svn.geant.net/GEANT/edugain_testidp_account_manager/trunk@60 047e039d-479c-447e-8a29-aa6bf4a09bab
parent f6d30e6e
No related branches found
No related tags found
No related merge requests found
......@@ -130,6 +130,9 @@ if ($options{'add_test_account'}) {
if ($options{'token'}) {
push @{$args{'query'}}, 'token' => $options{'token'};
}
if ($options{'filter_expired'}) {
push @{$args{'query'}}, 'creation_date' => {lt => time-($Conf::global{'tokens_validity_period'} * 3600)};
}
my $all = IdPAccountManager::AuthenticationToken::list_authentication_tokens(%args);
......@@ -139,8 +142,14 @@ if ($options{'add_test_account'}) {
foreach my $authentication_token (@$all) {
$authentication_token->print();
$authentication_token->delete || die if ($options{'delete'});
}
if ($options{'delete'}) {
printf "%d tokens removed\n", $#{$all}+1;
}
}elsif ($options{'get_authentication_token'}) {
my %args;
......@@ -252,6 +261,14 @@ Parses the SAML metadata file, as defined by the C<federation_metadata_file_path
List all authentication tokens. Criterias can be added to filter tokens.
=item C<account-manager-client.pl --list_authentication_tokens --filter_expired>
List all expired authentication tokens.
=item C<account-manager-client.pl --list_authentication_tokens --filter_expired --delete>
Remove all expired authentication tokens from DB.
=item C<account-manager-client.pl --get_authentication_token --token=dhj67sjJ>
Get informations on a token.
......
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