Return error if no OpenID Provider configured (#183)

This commit is contained in:
Clément Oudot 2015-10-22 13:40:11 +00:00
parent aa3e2470dc
commit 8c109061a9

View File

@ -198,9 +198,15 @@ sub extractFormInfo {
my $urlcheck = $self->controlUrlOrigin();
return $urlcheck unless ( $urlcheck == PE_OK );
# Auto select provider if there is only one
my @oplist = sort keys %{ $self->{_oidcOPList} };
# Error if no provider configured
if ( $#oplist == -1 ) {
$self->lmLog( "No OP configured", 'error' );
return PE_ERROR;
}
# Auto select provider if there is only one
if ( $#oplist == 0 ) {
$op = shift @oplist;
$self->lmLog( "Selecting the only defined OP: $op", 'debug' );