Skip to content

Commit

Permalink
Merge pull request #208 from waterkip/GH-crappy-idps
Browse files Browse the repository at this point in the history
Fix boolean values for integrations with crappy IdP's
  • Loading branch information
timlegge authored Apr 17, 2024
2 parents 239d1b4 + bcfc4d2 commit 0f0f8f9
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 0f0f8f9

Please sign in to comment.