diff --git a/lemonldap-ng-common/scripts/importMetadata b/lemonldap-ng-common/scripts/importMetadata index 8ae910265..13b534428 100755 --- a/lemonldap-ng-common/scripts/importMetadata +++ b/lemonldap-ng-common/scripts/importMetadata @@ -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'; }