Skip to content

Commit 9f41ae3

Browse files
committed
Fix testapp metadata generation
1 parent 303a8a2 commit 9f41ae3

File tree

1 file changed

+18
-3
lines changed

1 file changed

+18
-3
lines changed

xt/testapp/lib/Saml2Test.pm

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ use Dancer ':syntax';
1717
use Net::SAML2;
1818
use MIME::Base64 qw/ decode_base64 /;
1919
use File::Slurper qw/ read_dir /;
20+
use URN::OASIS::SAML2 qw(:bindings :urn);
2021

2122
our $VERSION = '0.2';
2223

@@ -245,6 +246,7 @@ post '/sls-post-response' => sub {
245246

246247
get '/metadata.xml' => sub {
247248
content_type 'application/octet-stream';
249+
248250
my $sp = _sp();
249251
return $sp->metadata;
250252
};
@@ -255,17 +257,30 @@ sub _sp {
255257
url => config->{url},
256258
cert => config->{cert},
257259
key => config->{key},
258-
cacert => config->{cacert},
260+
cacert => config->{cacert} || '',
259261
slo_url_soap => config->{slo_url_soap},
260262
slo_url_redirect => config->{slo_url_redirect},
261263
slo_url_post => config->{slo_url_post},
262-
acs_url_post => config->{acs_url_post},
263-
acs_url_artifact => config->{acs_url_artifact},
264+
assertion_consumer_service => [
265+
{
266+
Binding => BINDING_HTTP_POST,
267+
Location => config->{slo_url_post},
268+
isDefault => 'false',
269+
# optionally
270+
index => 1,
271+
},
272+
{
273+
Binding => BINDING_HTTP_ARTIFACT,
274+
Location => config->{acs_url_artifact},
275+
isDefault => 'true',
276+
index => 2,
277+
}],
264278
error_url => config->{error_url},
265279

266280
org_name => config->{org_name},
267281
org_display_name => config->{org_display_name},
268282
org_contact => config->{org_contact},
283+
authnreq_signed => config->{authnreq_signed},
269284
);
270285
return $sp;
271286
}

0 commit comments

Comments
 (0)