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 abcedf80506..4171e775a70 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.