Skip to content

Commit bcfc4d2

Browse files
committed
Fix boolean values for integrations with crappy IdP's
Some IdP's (KPN telecom, NL) don't follow the XML standards for boolean values as defined in https://www.w3.org/TR/xmlschema-2/#boolean They are reluctant to change their world view as they hold dominance in their markets. Signed-off-by: Wesley Schwengle <waterkip@cpan.org>
1 parent 239d1b4 commit bcfc4d2

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

lib/Net/SAML2/SP.pm

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -609,8 +609,8 @@ sub generate_metadata {
609609
$x->SPSSODescriptor(
610610
$md,
611611
{
612-
AuthnRequestsSigned => $self->authnreq_signed,
613-
WantAssertionsSigned => $self->want_assertions_signed,
612+
AuthnRequestsSigned => $self->authnreq_signed ? 'true' : 'false',
613+
WantAssertionsSigned => $self->want_assertions_signed ? 'true' : 'false',
614614
errorURL => $error_uri,
615615
protocolSupportEnumeration => URN_PROTOCOL,
616616
},

t/02-create-sp.t

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@ use URN::OASIS::SAML2 qw(:bindings :urn);
2424
my $node
2525
= get_single_node_ok($xpath,
2626
'//md:EntityDescriptor/md:SPSSODescriptor');
27-
ok(!$node->getAttribute('WantAssertionsSigned'),
27+
is($node->getAttribute('WantAssertionsSigned'), 'false',
2828
'Wants assertions to be signed');
29-
ok(
30-
!$node->getAttribute('AuthnRequestsSigned'),
29+
is(
30+
$node->getAttribute('AuthnRequestsSigned'), 'false',
3131
'.. and also authn requests to be signed'
3232
);
3333

@@ -165,9 +165,9 @@ use URN::OASIS::SAML2 qw(:bindings :urn);
165165
# Test SPSSODescriptor
166166
my $node = get_single_node_ok($xpath, '/node()/md:SPSSODescriptor');
167167
is($node->getAttribute('AuthnRequestsSigned'),
168-
'1', '.. and authn request needs signing');
168+
'true', '.. and authn request needs signing');
169169
is($node->getAttribute('WantAssertionsSigned'),
170-
'1', '.. as does assertions');
170+
'true', '.. as does assertions');
171171
is($node->getAttribute('errorURL'),
172172
'http://localhost:3000/error', 'Got the correct error URI');
173173
is(

0 commit comments

Comments
 (0)