Fix eduPersonTargetedID when creating provider (#2645)

This commit is contained in:
Maxime Besson 2021-10-21 13:57:30 +02:00
parent b4e6aeaff3
commit c598b07a83

View File

@ -339,18 +339,20 @@ foreach
}
else {
# Check if entityID already in configuration
my $confKey;
if ( defined $spList->{$entityID} ) {
$confKey = $spList->{$entityID};
# Update metadata
$lastConf->{samlSPMetaDataXML}->{ $spList->{$entityID} }
$lastConf->{samlSPMetaDataXML}->{$confKey}
->{samlSPMetaDataXML} = $partner_metadata;
# Update attributes
$lastConf->{samlSPMetaDataExportedAttributes}
->{ $spList->{$entityID} } = $requestedAttributes;
$lastConf->{samlSPMetaDataOptions}->{ $spList->{$entityID} }
= { %{$spOptions} };
$lastConf->{samlSPMetaDataOptions}->{$confKey} =
{ %{$spOptions} };
if ( $opts{verbose} ) {
print "Update SP $entityID in configuration\n";
@ -359,7 +361,7 @@ foreach
}
else {
# Create a new partner
my $confKey = toEntityIDkey( $spConfKeyPrefix, $entityID );
$confKey = toEntityIDkey( $spConfKeyPrefix, $entityID );
# Metadata
$lastConf->{samlSPMetaDataXML}->{$confKey}
@ -380,9 +382,12 @@ foreach
}
# handle eduPersonTargetedID
if ( $requestedAttributes->{eduPersonTargetedID} ) {
delete $requestedAttributes->{eduPersonTargetedID};
$lastConf->{samlSPMetaDataOptions}->{ $spList->{$entityID} }
if ( $lastConf->{samlSPMetaDataExportedAttributes}->{$confKey}
->{eduPersonTargetedID} )
{
delete $lastConf->{samlSPMetaDataExportedAttributes}
->{$confKey}->{eduPersonTargetedID};
$lastConf->{samlSPMetaDataOptions}->{$confKey}
->{samlSPMetaDataOptionsNameIDFormat} = 'persistent';
}