Skip to content

Commit

Permalink
Fix boolean values for integrations with crappy IdP's
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
waterkip committed Apr 10, 2024
1 parent 239d1b4 commit bcfc4d2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions lib/Net/SAML2/SP.pm
Original file line number Diff line number Diff line change
Expand Up @@ -609,8 +609,8 @@ sub generate_metadata {
$x->SPSSODescriptor(
$md,
{
AuthnRequestsSigned => $self->authnreq_signed,
WantAssertionsSigned => $self->want_assertions_signed,
AuthnRequestsSigned => $self->authnreq_signed ? 'true' : 'false',
WantAssertionsSigned => $self->want_assertions_signed ? 'true' : 'false',
errorURL => $error_uri,
protocolSupportEnumeration => URN_PROTOCOL,
},
Expand Down
10 changes: 5 additions & 5 deletions t/02-create-sp.t
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ use URN::OASIS::SAML2 qw(:bindings :urn);
my $node
= get_single_node_ok($xpath,
'//md:EntityDescriptor/md:SPSSODescriptor');
ok(!$node->getAttribute('WantAssertionsSigned'),
is($node->getAttribute('WantAssertionsSigned'), 'false',
'Wants assertions to be signed');
ok(
!$node->getAttribute('AuthnRequestsSigned'),
is(
$node->getAttribute('AuthnRequestsSigned'), 'false',
'.. and also authn requests to be signed'
);

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

0 comments on commit bcfc4d2

Please sign in to comment.