SAML: reformate SP list to use EntityID as primary key

This commit is contained in:
Clément Oudot 2010-04-15 14:42:17 +00:00
parent fbe50de653
commit 4379adc014
2 changed files with 20 additions and 3 deletions

View File

@ -223,6 +223,24 @@ sub issuerForAuthUser {
return PE_ERROR;
}
# Get EntityID
my $entityID = $login->request->Issuer->content;
$self->lmLog( "Request issued from $entityID", 'debug' );
# Find EntityID in SPList
unless ( defined $self->{_spList}->{$entityID} ) {
$self->lmLog( "$entityID do not match any known SP", 'error' );
return PE_ERROR;
}
$self->lmLog(
"Using SP "
. $self->{_spList}->{$entityID}->{name}
. " configuration",
'debug'
);
# Validate request
unless ( $self->validateRequestMsg( $login, 1, 1 ) ) {
$self->lmLog( "Unable to validate SSO request message",

View File

@ -244,9 +244,8 @@ sub loadSPs {
my $name =
$self->getOrganizationName( $self->{_lassoServer}, $entityID )
|| ucfirst($_);
$self->{_spList}->{$_} = ();
$self->{_spList}->{$_}->{entityID} = $entityID;
$self->{_spList}->{$_}->{name} = $name;
$self->{_spList}->{$entityID}->{confKey} = $_;
$self->{_spList}->{$entityID}->{name} = $name;
$self->lmLog( "SP $_ added", 'debug' );
}