Add config tests for webauthn
This commit is contained in:
parent
c45819807f
commit
39da9c64a9
|
@ -6,6 +6,7 @@ use strict;
|
|||
use Lemonldap::NG::Common::Regexp;
|
||||
use Lemonldap::NG::Handler::Main;
|
||||
use Lemonldap::NG::Common::Util qw(getSameSite);
|
||||
use URI;
|
||||
|
||||
our $VERSION = '2.0.14';
|
||||
|
||||
|
@ -550,6 +551,28 @@ sub tests {
|
|||
) if ($@);
|
||||
}
|
||||
|
||||
# Use WebAuthn
|
||||
if ( $conf->{webauthn2fActivation}
|
||||
{
|
||||
eval "use Authen::WebAuthn";
|
||||
return ( 1,
|
||||
"Authen::WebAuthn module is required to enable WebAuthn"
|
||||
) if ($@);
|
||||
}
|
||||
|
||||
# WebAuthn requires https://
|
||||
if ( $conf->{webauthn2fActivation}
|
||||
{
|
||||
my $portal_uri = URI->new($conf->{portal});
|
||||
if ($portal_uri->scheme eq "https") {
|
||||
return 1;
|
||||
} else {
|
||||
return ( 1,
|
||||
"WebAuthn requires HTTPS"
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
# Use Yubikey
|
||||
if ( $conf->{yubikey2fActivation} ) {
|
||||
eval "use Auth::Yubikey_WebClient";
|
||||
|
|
Loading…
Reference in New Issue