diff --git a/lib/IdPAccountManager/SAMLMetadata.pm b/lib/IdPAccountManager/SAMLMetadata.pm index 6426bc0db348743ab739811e25c38a3d98362271..8906a25b77d7a9534d1a265d200712b81d5c9535 100644 --- a/lib/IdPAccountManager/SAMLMetadata.pm +++ b/lib/IdPAccountManager/SAMLMetadata.pm @@ -6,8 +6,6 @@ use warnings; use English qw(-no_match_vars); use XML::LibXML qw(:libxml); -use IdPAccountManager::Tools; - sub new { my ($pkg, %args) = @_; @@ -112,14 +110,9 @@ sub parse { ## Requested attributes information push @{ $data->{requested_attribute} }, { - 'friendly_name' => - IdPAccountManager::Tools::encode_utf8( - $attribute->getAttribute('FriendlyName') - ), - 'name' => IdPAccountManager::Tools::encode_utf8( - $attribute->getAttribute('Name') - ), - 'is_required' => _boolean2integer( + 'friendly_name' => $attribute->getAttribute('FriendlyName'), + 'name' => $attribute->getAttribute('Name'), + 'is_required' => _boolean2integer( $attribute->getAttribute('isRequired') ) }; @@ -143,10 +136,8 @@ sub parse { ) { if ($registrationpolicy->getAttribute('lang') eq 'en') { - $data->{registration_info} - {registration_policy} = - IdPAccountManager::Tools::encode_utf8( - $registrationpolicy->textContent()); + $data->{registration_info}->{registration_policy} = + $registrationpolicy->textContent(); } } } @@ -156,8 +147,7 @@ sub parse { if (defined $contact_details{type}) { foreach my $contact_child ($child->childNodes()) { $contact_details{ $contact_child->localName } = - IdPAccountManager::Tools::encode_utf8( - $contact_child->textContent()); + $contact_child->textContent(); } push @{ $data->{contacts} }, \%contact_details; } @@ -167,10 +157,8 @@ sub parse { my $displayname ($child->getElementsByLocalName('DisplayName')) { - $data->{display_name} - { $displayname->getAttribute('xml:lang') } = - IdPAccountManager::Tools::encode_utf8( - $displayname->textContent()); + $data->{display_name}->{ $displayname->getAttribute('xml:lang') } = + $displayname->textContent(); ## Set a default displayName in case no English version is provided ## However there is no way to determine the native displayName @@ -178,9 +166,7 @@ sub parse { if ( !$data->{default_display_name} || $displayname->getAttribute('xml:lang')) { - $data->{default_display_name} = - IdPAccountManager::Tools::encode_utf8( - $displayname->textContent()); + $data->{default_display_name} = $displayname->textContent(); } } @@ -189,10 +175,8 @@ sub parse { my $description ($child->getElementsByLocalName('Description')) { - $data->{description} - { $description->getAttribute('xml:lang') } = - IdPAccountManager::Tools::encode_utf8( - $description->textContent()); + $data->{description}->{ $description->getAttribute('xml:lang') } = + $description->textContent(); } foreach @@ -204,8 +188,7 @@ sub parse { $contact->getAttribute('contactType'); foreach my $contact_child ($EntityDescriptor->childNodes()) { $contact_details{ $contact_child->localName } = - IdPAccountManager::Tools::encode_utf8( - $contact_child->textContent()); + $contact_child->textContent(); } push @{ $data->{contacts} }, \%contact_details; } @@ -213,15 +196,13 @@ sub parse { foreach my $sso ( $child->getElementsByLocalName('OrganizationDisplayName')) { - $data->{organization} = - IdPAccountManager::Tools::encode_utf8($sso->textContent()); + $data->{organization} = $sso->textContent(); } ## Getting X.509 certificates foreach my $cert ($child->getElementsByLocalName('X509Certificate')) { - $data->{certificate} = - IdPAccountManager::Tools::encode_utf8($cert->textContent()); + $data->{certificate} = $cert->textContent(); } }