From f7db876da0c5d65242fe5f09d6da50c7a3b0e502 Mon Sep 17 00:00:00 2001 From: James Rouzier Date: Wed, 18 Dec 2024 11:49:38 +0000 Subject: [PATCH] use source from the profile if it does not match --- .../DynamicRouting/Module/Authentication/SAML.pm | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/html/captive-portal/lib/captiveportal/PacketFence/DynamicRouting/Module/Authentication/SAML.pm b/html/captive-portal/lib/captiveportal/PacketFence/DynamicRouting/Module/Authentication/SAML.pm index abcedf80506d..4171e775a70c 100644 --- a/html/captive-portal/lib/captiveportal/PacketFence/DynamicRouting/Module/Authentication/SAML.pm +++ b/html/captive-portal/lib/captiveportal/PacketFence/DynamicRouting/Module/Authentication/SAML.pm @@ -21,7 +21,11 @@ use pf::constants::realm; has 'landing_template' => ('is' => 'rw', default => sub {'saml.html'}); -has '+source' => (isa => 'pf::Authentication::Source::SAMLSource'); +has '+source' => ( + isa => 'pf::Authentication::Source::SAMLSource', + lazy => 1, + builder => '_build_source', +); has '+route_map' => (default => sub { tie my %map, 'Tie::IxHash', ( @@ -108,6 +112,11 @@ sub assertion { } } +sub _build_source { + my ($self) = @_; + return $self->app->profile->getSourceByType('SAML'); +} + =head1 AUTHOR Inverse inc.