@@ -63,7 +63,7 @@ sent regardless
6363
6464has ' session' => (isa => NonEmptySimpleStr, is => ' ro' , required => 1);
6565has ' nameid' => (isa => NonEmptySimpleStr, is => ' ro' , required => 1);
66- has ' nameid_format' => (isa => NonEmptySimpleStr, is => ' ro' , required => 1 );
66+ has ' nameid_format' => (isa => NonEmptySimpleStr, is => ' ro' , required => 0 );
6767has ' destination' => (isa => NonEmptySimpleStr, is => ' ro' , required => 0);
6868
6969=head2 new_from_xml( ... )
@@ -91,13 +91,19 @@ sub new_from_xml {
9191 $xpath -> registerNs(' saml' , ' urn:oasis:names:tc:SAML:2.0:assertion' );
9292 $xpath -> registerNs(' samlp' , ' urn:oasis:names:tc:SAML:2.0:protocol' );
9393
94- my $self = $class -> new (
94+ my %params = (
9595 id => $xpath -> findvalue(' /samlp:LogoutRequest/@ID' ),
9696 session => $xpath -> findvalue(' /samlp:LogoutRequest/samlp:SessionIndex' ),
9797 issuer => $xpath -> findvalue(' /samlp:LogoutRequest/saml:Issuer' ),
9898 nameid => $xpath -> findvalue(' /samlp:LogoutRequest/saml:NameID' ),
99- nameid_format => $xpath -> findvalue(' /samlp:LogoutRequest/saml:NameID/@Format' ),
100- destination => $xpath -> findvalue(' /samlp:LogoutRequest/saml:NameID/@NameQualifier' ),
99+ destination => $xpath -> findvalue(' /samlp:LogoutRequest/@Destination' ),
100+ );
101+
102+ my $nameid_format = $xpath -> findvalue(' /samlp:LogoutRequest/saml:NameID/@Format' );
103+ if ( $nameid_format ne ' ' ) { $params {nameid_format } = $nameid_format ; }
104+
105+ my $self = $class -> new(
106+ %params
101107 );
102108
103109 return $self ;
0 commit comments