Commit 29834abb authored by Christophe Maudoux's avatar Christophe Maudoux 🐛

Fix typo (#1386)

parent 6a4c7763
......@@ -247,7 +247,7 @@
"facebookParams":"Facebook parameters",
"failedLoginNumber":"Number of registered failed logins",
"fileToUpload":"File to upload",
"forbidden":"You're not authorizated to show this page",
"forbidden":"You're not authorized to show this page",
"forceSave":"Force save",
"format":"Format",
"formReplay":"Form replay",
......@@ -536,7 +536,7 @@
"openIdAttr":"OpenID login",
"openIdAuthnLevel":"Authentication level",
"openIdExportedVars":"Exported variables",
"openIdIDPList":"Authorizated domains",
"openIdIDPList":"Authorized domains",
"openIdIssuerSecret":"Secret token",
"openidParams":"OpenID parameters",
"openIdSecret":"Secret token",
......@@ -550,7 +550,7 @@
"openIdSreg_gender":"Gender",
"openIdSreg_email":"Email",
"openIdSreg_dob":"Date of birth",
"openIdSPList":"Authorizated domains",
"openIdSPList":"Authorized domains",
"OpenIDConnect":"OpenID Connect",
"OptionalTitle":"Optional title",
"overPrm":"Overloaded parameters",
......
......@@ -43,10 +43,6 @@ has ott => (
sub init {
my ($self) = @_;
# Set default 2F list
#$self->conf->{available2F} ||= 'UTOTP,TOTP,U2F,REST,Ext2F,Yubikey';
#$self->conf->{available2FSelfRegistration} ||= 'TOTP,U2F,Yubikey';
# Load 2F modules
for my $i ( 0 .. 1 ) {
foreach (
......@@ -118,7 +114,7 @@ sub run {
# Skip 2F unless a module has been registered
return PE_OK unless ( @{ $self->sfModules } );
########################################################################
# Search for authorized modules for this user
my @am;
foreach my $m ( @{ $self->sfModules } ) {
......@@ -129,8 +125,8 @@ sub run {
push @am, $m->{m};
}
}
########################################################################
# If no 2F modules are authorized, skipping 2F
# If no 2F module is authorized, skipping 2F
# Note that a rule may forbid access after (GrantSession plugin)
return PE_OK unless (@am);
......@@ -263,12 +259,12 @@ sub _displayRegister {
[] ];
}
my $_2FDevices = eval { from_json( $req->userData->{_2FDevices},
my $_2fDevices = eval { from_json( $req->userData->{_2fDevices},
{ allow_nonref => 1 } ); };
unless ($_2FDevices) {
unless ($_2fDevices) {
$self->logger->debug("No 2F Device found");
$_2FDevices = [];
$_2fDevices = [];
}
return $self->p->sendHtml(
......@@ -277,7 +273,7 @@ sub _displayRegister {
params => {
SKIN => $self->conf->{portalSkin},
MODULES => \@am,
SFDEVICES => $_2FDevices,
SFDEVICES => $_2fDevices,
}
);
}
......
......@@ -101,17 +101,17 @@ sub run {
$self->p->updatePersistentSession( $req,
{ _totp2fSecret => $token->{_totp2fSecret} } );
my $_2FDevices = eval {
my $_2fDevices = eval {
$self->logger->debug("Looking for 2F Devices ...");
from_json( $req->userData->{_2FDevices}, { allow_nonref => 1 } );
from_json( $req->userData->{_2fDevices}, { allow_nonref => 1 } );
};
unless ($_2FDevices) {
unless ($_2fDevices) {
$self->logger->debug("No 2F Device found");
$_2FDevices = [];
$_2fDevices = [];
}
# Check if user can register one more device
my $size = @$_2FDevices;
my $size = @$_2fDevices;
my $maxSize = $self->conf->{max2FDevices};
$self->logger->debug("Nbr 2FDevices = $size / $maxSize");
if ( $size >= $maxSize ) {
......@@ -120,7 +120,7 @@ sub run {
400 );
}
push @{$_2FDevices},
push @{$_2fDevices},
{
type => 'TOTP',
name => $TOTPName,
......@@ -131,7 +131,7 @@ sub run {
$self->logger->debug(
"Append 2F Device : { type => 'totp', name => $TOTPName }");
$self->p->updatePersistentSession( $req,
{ _2FDevices => to_json($_2FDevices) } );
{ _2fDevices => to_json($_2fDevices) } );
$self->userLogger->notice('TOTP registration succeed');
return [ 200, [ 'Content-Type' => 'application/json' ],
......@@ -201,16 +201,16 @@ sub run {
}
elsif ( $action eq 'delete' ) {
my $epoch = $req->param('epoch');
my $_2FDevices = eval {
my $_2fDevices = eval {
$self->logger->debug("Loading 2F Devices ...");
# Read existing 2FDevices
from_json( $req->userData->{_2FDevices}, { allow_nonref => 1 } );
from_json( $req->userData->{_2fDevices}, { allow_nonref => 1 } );
};
my @keep = ();
while (@$_2FDevices) {
my $element = shift @$_2FDevices;
while (@$_2fDevices) {
my $element = shift @$_2fDevices;
$self->logger->debug("Looking for 2F device to delete ...");
push @keep, $element unless ( $element->{epoch} eq $epoch );
}
......@@ -218,7 +218,7 @@ sub run {
$self->logger->debug(
"Delete 2F Device : { type => 'TOTP', epoch => $epoch }");
$self->p->updatePersistentSession( $req,
{ _2FDevices => to_json( \@keep ) } );
{ _2fDevices => to_json( \@keep ) } );
$self->userLogger->notice('TOTP deletion succeed');
return [ 200, [ 'Content-Type' => 'application/json' ],
['{"result":1}'] ];
......
......@@ -32,22 +32,22 @@ sub run {
if ( $action eq 'register' ) {
# Check if user can register one more device
my $_2FDevices = eval {
my $_2fDevices = eval {
$self->logger->debug("Looking for 2F Devices ...");
# Read existing 2FDevices
from_json( $req->userData->{_2FDevices}, { allow_nonref => 1 } );
from_json( $req->userData->{_2fDevices}, { allow_nonref => 1 } );
};
unless ($_2FDevices) {
unless ($_2fDevices) {
$self->logger->debug("No 2F Device found");
# Set default value
$_2FDevices = [];
$_2fDevices = [];
}
my $size = @$_2FDevices;
my $size = @$_2fDevices;
my $maxSize = $self->conf->{max2FDevices};
$self->logger->debug("Nbr 2FDevices = $size / $maxSize");
$self->logger->debug("Registered 2F Device(s) : $size / $maxSize");
if ( $size >= $maxSize ) {
$self->userLogger->error("Max number of 2F devices is reached !!!");
return $self->p->sendError( $req, 'maxNumberof2FDevicesReached',
......@@ -87,18 +87,18 @@ sub run {
my ( $keyHandle, $userKey ) = $c->registrationVerify($resp);
if ( $keyHandle and $userKey ) {
my $_2FDevices = eval {
my $_2fDevices = eval {
$self->logger->debug("Looking for 2F Devices ...");
# Read existing 2FDevices
from_json( $req->userData->{_2FDevices},
from_json( $req->userData->{_2fDevices},
{ allow_nonref => 1 } );
};
unless ($_2FDevices) {
unless ($_2fDevices) {
$self->logger->debug("No 2F Device found");
# Set default value
$_2FDevices = [];
$_2fDevices = [];
}
my $keyName = $req->param('keyName');
......@@ -110,7 +110,7 @@ sub run {
substr( $keyName, 0, $self->conf->{max2FDevicesNameLength} );
$self->logger->debug("Key name : $keyName");
push @{$_2FDevices},
push @{$_2fDevices},
{
type => 'U2F',
name => $keyName,
......@@ -121,7 +121,7 @@ sub run {
$self->logger->debug(
"Append 2F Device : { type => 'U2F', name => $keyName }");
$self->p->updatePersistentSession( $req,
{ _2FDevices => to_json($_2FDevices) } );
{ _2fDevices => to_json($_2fDevices) } );
$self->p->updatePersistentSession(
$req,
......@@ -165,6 +165,7 @@ sub run {
[$challenge]
];
}
elsif ( $action eq 'signature' ) {
$self->logger->debug('Verification response');
my ( $challenge, $resp );
......@@ -228,16 +229,16 @@ sub run {
}
elsif ( $action eq 'delete' ) {
my $epoch = $req->param('epoch');
my $_2FDevices = eval {
my $_2fDevices = eval {
$self->logger->debug("Loading 2F Devices ...");
# Read existing 2FDevices
from_json( $req->userData->{_2FDevices}, { allow_nonref => 1 } );
from_json( $req->userData->{_2fDevices}, { allow_nonref => 1 } );
};
my @keep = ();
while (@$_2FDevices) {
my $element = shift @$_2FDevices;
while (@$_2fDevices) {
my $element = shift @$_2fDevices;
$self->logger->debug("Looking for 2F device to delete ...");
push @keep, $element unless ( $element->{epoch} eq $epoch );
}
......@@ -245,7 +246,7 @@ sub run {
$self->logger->debug(
"Delete 2F Device : { type => 'U2F', epoch => $epoch }");
$self->p->updatePersistentSession( $req,
{ _2FDevices => to_json( \@keep ) } );
{ _2fDevices => to_json( \@keep ) } );
$self->p->updatePersistentSession(
$req,
......
......@@ -51,19 +51,19 @@ sub run {
#. substr( $otp, 0, $self->conf->{yubikey2fPublicIDSize} );
my $key = substr( $otp, 0, $self->conf->{yubikey2fPublicIDSize} );
my $_2FDevices = eval {
my $_2fDevices = eval {
$self->logger->debug("Looking for 2F Devices ...");
from_json( $req->userData->{_2FDevices},
from_json( $req->userData->{_2fDevices},
{ allow_nonref => 1 } );
};
unless ($_2FDevices) {
unless ($_2fDevices) {
$self->logger->debug("No 2F Device found");
$_2FDevices = [];
$_2fDevices = [];
}
# Search if Yubikey has been already registered
my $SameUBKFound = 0;
foreach (@$_2FDevices) {
foreach (@$_2fDevices) {
$self->logger->debug("Reading Yubikeys ...");
if ( $_->{_yubikey} eq $key ) {
$SameUBKFound = 1;
......@@ -84,7 +84,7 @@ sub run {
}
# Check if user can register one more device
my $size = @$_2FDevices;
my $size = @$_2fDevices;
my $maxSize = $self->conf->{max2FDevices};
$self->logger->debug("Nbr 2FDevices = $size / $maxSize");
if ( $size >= $maxSize ) {
......@@ -99,7 +99,7 @@ sub run {
);
}
push @{$_2FDevices},
push @{$_2fDevices},
{
type => 'UBK',
name => $UBKName,
......@@ -110,7 +110,7 @@ sub run {
$self->logger->debug(
"Append 2F Device : { type => 'UBK', name => $UBKName }");
$self->p->updatePersistentSession( $req,
{ _2FDevices => to_json($_2FDevices) } );
{ _2fDevices => to_json($_2fDevices) } );
#$self->p->updatePersistentSession( $req, { _yubikeys => $keys } );
return $self->p->sendHtml(
......@@ -140,16 +140,16 @@ sub run {
if ( $action eq 'delete' ) {
my $epoch = $req->param('epoch');
my $_2FDevices = eval {
my $_2fDevices = eval {
$self->logger->debug("Loading 2F Devices ...");
# Read existing 2FDevices
from_json( $req->userData->{_2FDevices}, { allow_nonref => 1 } );
from_json( $req->userData->{_2fDevices}, { allow_nonref => 1 } );
};
my @keep = ();
while (@$_2FDevices) {
my $element = shift @$_2FDevices;
while (@$_2fDevices) {
my $element = shift @$_2fDevices;
$self->logger->debug("Looking for 2F device to delete ...");
push @keep, $element unless ( $element->{epoch} eq $epoch );
}
......@@ -157,7 +157,7 @@ sub run {
$self->logger->debug(
"Delete 2F Device : { type => 'UBK', epoch => $epoch }");
$self->p->updatePersistentSession( $req,
{ _2FDevices => to_json( \@keep ) } );
{ _2fDevices => to_json( \@keep ) } );
$self->userLogger->notice('Yubikey deletion succeed');
return [
......
......@@ -18,7 +18,7 @@ extends 'Lemonldap::NG::Portal::Main::SecondFactor';
has prefix => ( is => 'ro', default => 'yubikey' );
has logo => ( is => 'rw', default => 'u2f.png' );
has logo => ( is => 'rw', default => 'yubikey.png' );
has yubi => ( is => 'rw' );
......@@ -32,7 +32,8 @@ sub init {
if ( $self->conf->{yubikey2fSelfRegistration}
and $self->conf->{yubikey2fActivation} eq '1' )
{
$self->conf->{yubikey2fActivation} = '$_yubikeys';
#$self->conf->{yubikey2fActivation} = '$_yubikeys';
$self->conf->{yubikey2fActivation} = '$_2fDevices';
}
unless ($self->conf->{yubikey2fClientID}
and $self->conf->{yubikey2fSecretKey} )
......@@ -57,12 +58,12 @@ sub init {
sub run {
my ( $self, $req, $token ) = @_;
my $yubikey = 0;
my $_2FDevices = eval {
my $_2fDevices = eval {
$self->logger->debug("Looking for 2F Devices ...");
from_json( $req->{sessionInfo}->{_2FDevices}, { allow_nonref => 1 } );
from_json( $req->{sessionInfo}->{_2fDevices}, { allow_nonref => 1 } );
};
foreach (@$_2FDevices) {
foreach (@$_2fDevices) {
$self->logger->debug("Reading Yubikey ...");
if ( $_->{type} eq 'UBK' ) {
$yubikey = $_->{_yubikey};
......@@ -106,12 +107,12 @@ sub verify {
# Verify OTP
my $yubikey = 0;
my $_2FDevices = eval {
my $_2fDevices = eval {
$self->logger->debug("Looking for 2F Devices ...");
from_json( $session->{_2FDevices}, { allow_nonref => 1 } );
from_json( $session->{_2fDevices}, { allow_nonref => 1 } );
};
foreach (@$_2FDevices) {
foreach (@$_2fDevices) {
$self->logger->debug("Reading Yubikey ...");
if ( $_->{type} eq 'UBK' ) {
$yubikey = $_->{_yubikey};
......
......@@ -83,7 +83,7 @@
"PE81":"Invalid authentication attempt",
"PE82":"Exceeded authentication timeout",
"PE83":"U2F verification failed",
"PE84":"You're not authorizated to access to this host",
"PE84":"You're not authorized to access to this host",
"PE85":"The remote site ask for a newer session (and UpgradeSession plugin isn't loaded). Logout and retry",
"2FManagment":"2ndF Managment",
"accept":"Accept",
......
......@@ -83,7 +83,7 @@
"PE81":"Invalid authentication attempt",
"PE82":"Exceeded authentication timeout",
"PE83":"U2F verification failed",
"PE84":"You're not authorizated to access to this host",
"PE84":"You're not authorized to access to this host",
"PE85":"The remote site ask for a newer session (and UpgradeSession plugin isn't loaded). Logout and retry",
"2FManagment":"2ndF Managment",
"accept":"Accept",
......
......@@ -83,7 +83,7 @@
"PE81":"Invalid authentication attempt",
"PE82":"Exceeded authentication timeout",
"PE83":"U2F verification failed",
"PE84":"You're not authorizated to access to this host",
"PE84":"You're not authorized to access to this host",
"PE85":"The remote site ask for a newer session (and UpgradeSession plugin isn't loaded). Logout and retry",
"2FManagment":"2ndF Managment",
"accept":"Accept",
......
......@@ -83,7 +83,7 @@
"PE81":"Invalid authentication attempt",
"PE82":"Exceeded authentication timeout",
"PE83":"U2F verification failed",
"PE84":"You're not authorizated to access to this host",
"PE84":"You're not authorized to access to this host",
"PE85":"The remote site ask for a newer session (and UpgradeSession plugin isn't loaded). Logout and retry",
"2FManagment":"Gestionnaire 2ndF",
"accept":"Accept",
......
......@@ -83,7 +83,7 @@
"PE81":"Invalid authentication attempt",
"PE82":"Exceeded authentication timeout",
"PE83":"U2F verification failed",
"PE84":"You're not authorizated to access to this host",
"PE84":"You're not authorized to access to this host",
"PE85":"The remote site ask for a newer session (and UpgradeSession plugin isn't loaded). Logout and retry",
"2FManagment":"Gestionnaire 2ndF",
"accept":"Accept",
......
......@@ -83,7 +83,7 @@
"PE81":"Invalid authentication attempt",
"PE82":"Exceeded authentication timeout",
"PE83":"U2F verification failed",
"PE84":"You're not authorizated to access to this host",
"PE84":"You're not authorized to access to this host",
"PE85":"The remote site ask for a newer session (and UpgradeSession plugin isn't loaded). Logout and retry",
"2FManagment":"Gestionnaire 2ndF",
"accept":"Accept",
......
......@@ -45,7 +45,7 @@
</TMPL_IF>
<div class="buttons">
<a href="<TMPL_VAR NAME="PORTAL_URL">/2fregisters" class="btn btn-warning" role="button">
<a href="<TMPL_VAR NAME="PORTAL_URL">2fregisters" class="btn btn-warning" role="button">
<span class="glyphicon glyphicon-pencil"></span>&nbsp;
<span trspan="2FManagment">2F managment</span>
</a>
......
......@@ -36,7 +36,7 @@
</main>
<div class="buttons">
<a href="<TMPL_VAR NAME="PORTAL_URL">/2fregisters" class="btn btn-warning" role="button">
<a href="<TMPL_VAR NAME="PORTAL_URL">2fregisters" class="btn btn-warning" role="button">
<span class="glyphicon glyphicon-pencil"></span>&nbsp;
<span trspan="2FManagment">2F managment</span>
</a>
......
......@@ -31,7 +31,7 @@
</main>
<div class="buttons">
<a href="<TMPL_VAR NAME="PORTAL_URL">/2fregisters" class="btn btn-warning" role="button">
<a href="<TMPL_VAR NAME="PORTAL_URL">2fregisters" class="btn btn-warning" role="button">
<span class="glyphicon glyphicon-pencil"></span>&nbsp;
<span trspan="2FManagment">2F managment</span>
</a>
......
......@@ -20,7 +20,7 @@
<div class="buttons">
<a href="<TMPL_VAR NAME="PORTAL_URL">/2fregisters" class="btn btn-warning" role="button">
<a href="<TMPL_VAR NAME="PORTAL_URL">2fregisters" class="btn btn-warning" role="button">
<span class="glyphicon glyphicon-pencil"></span>&nbsp;
<span trspan="2FManagment">2F managment</span>
</a>
......
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