Skip to content

Commit

Permalink
testapp: prevent app error if the are no slo_urls
Browse files Browse the repository at this point in the history
  • Loading branch information
timlegge committed Oct 18, 2021
1 parent c2c9e4b commit f694501
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions xt/testapp/lib/Saml2Test.pm
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,11 @@ get '/logout-redirect' => sub {
my $idp = _idp();
my $sp = _sp();

if ( ! defined $idp->slo_url('urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect') ) {
redirect "/", 302;
return; # "Redirected\n";
}

my $logoutreq = $sp->logout_request(
$idp->slo_url('urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect'),
params->{nameid},
Expand All @@ -63,6 +68,12 @@ get '/logout-redirect' => sub {
get '/logout-soap' => sub {
my $idp = _idp();
my $slo_url = $idp->slo_url('urn:oasis:names:tc:SAML:2.0:bindings:SOAP');

if ( ! defined $slo_url ) {
redirect "/", 302;
return "Redirected\n";
}

my $idp_cert = $idp->cert('signing');

my $sp = _sp();
Expand Down

0 comments on commit f694501

Please sign in to comment.