Commit 17e77d90 authored by Clément OUDOT's avatar Clément OUDOT
Browse files

Test if redirect URI in an OIDC RP is defined before saving configuration (#2040)

parent 39f93b0e
......@@ -4,7 +4,7 @@ use utf8;
use Lemonldap::NG::Common::Regexp;
use Lemonldap::NG::Handler::Main;
our $VERSION = '2.0.6';
our $VERSION = '2.0.7';
## @method hashref tests(hashref conf)
# Return a hash ref where keys are the names of the tests and values
......@@ -719,6 +719,26 @@ sub tests {
return 1;
},
# OIDC redirect URI must not be empty
oidcRPRedirectURINotEmpty => sub {
return 1
unless ( $conf->{oidcRPMetaDataOptions}
and %{ $conf->{oidcRPMetaDataOptions} } );
my @msg;
my $res = 1;
foreach my $oidcRpId ( keys %{ $conf->{oidcRPMetaDataOptions} } ) {
unless ( $conf->{oidcRPMetaDataOptions}->{$oidcRpId}
->{oidcRPMetaDataOptionsRedirectUris} )
{
push @msg,
"$oidcRpId OpenID Connect RP has no redirect URI defined";
$res = 0;
next;
}
}
return ( $res, join( ', ', @msg ) );
},
};
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment