ation
package Lemonldap::NG::Portal::2F::Register::Yubikey;
use strict;
use Mouse;
use JSON qw(from_json to_json);
use Lemonldap::NG::Portal::Main::Constants qw(
PE_FORMEMPTY
PE_ERROR
PE_OK
);
bAuthn;
use strict;
use Mouse;
use Lemonldap::NG::Portal::Main::Constants 'PE_OK';
use JSON qw(from_json to_json);
use MIME::Base64 qw(encode_base64url decode_base64url);
use Crypt::URandom;
our $VE
pt} .= <<"EOF";
<script type="text/javascript" src="$self->{p}->{staticPrefix}/common/js/webauthn-json.browser-global.min.js?v=$cacheTag"></script>
<script type="text/javascript" src="$self->{p}->{sta
est,
}
);
$self->logger->debug(
"WebAuthn registration parameters " . to_json($request) );
return $self->successResponse( $req,
{ request => $request, state_id =>
package Lemonldap::NG::Portal::Auth::LinkedIn;
use strict;
use JSON;
use Mouse;
use MIME::Base64 qw/encode_base64 decode_base64/;
use Lemonldap::NG::Common::FormEncode;
use Lemonldap::NG::Common::Use
tent;
my $json_hash;
eval { $json_hash = from_json( $content, { allow_nonref => 1 } ); };
if ($@) {
$self->logger->error("Unable to decode JSON $content");
return PE_ERROR;
}
my $access_token = $json_hash->{access_token};
$self->logger->debug("Get access token $access_token from LinkedIn");
# Call People EndPoint
their password
package Lemonldap::NG::Portal::2F::Password;
use strict;
use Mouse;
use JSON qw(from_json to_json);
use Lemonldap::NG::Common::Crypto;
use Lemonldap::NG::Common::Util qw/display2F/;
us
authenticators
package Lemonldap::NG::Portal::2F::WebAuthn;
use strict;
use Mouse;
use JSON qw(from_json to_json);
use MIME::Base64 qw(encode_base64url decode_base64url);
use Crypt::URandom;
use Lem
pt} .= <<"EOF";
<script type="text/javascript" src="$self->{p}->{staticPrefix}/common/js/webauthn-json.browser-global.min.js?v=$cacheTag"></script>
<script type="text/javascript" src="$self->{p}->{sta
ARGET => $self->p->relativeUrl( $req, 'webauthn2fcheck' ),
DATA =>
to_json( { request => $request, webauthn_autostart => \1 } ),
TOKEN => $token,
tered their U2F key
package Lemonldap::NG::Portal::2F::U2F;
use strict;
use Mouse;
use JSON qw(from_json to_json);
use MIME::Base64 qw(decode_base64url);
use Lemonldap::NG::Portal::Main::Constants qw
$res == 0;
# Get a challenge (from first key)
my $data = eval {
from_json( $req->data->{crypter}->[0]->authenticationChallenge );
};
if ($@) {
ebug( " -> send challenge: " . $data->{challenge} );
# Serialize data
$data = to_json( {
challenge => $data->{challenge},
appId => $data-
legacy OTP mode
package Lemonldap::NG::Portal::2F::Yubikey;
use strict;
use Mouse;
use JSON qw(from_json to_json);
use Lemonldap::NG::Common::Util qw/display2F/;
use Lemonldap::NG::Portal::Main::Cons
their TOTP secret
package Lemonldap::NG::Portal::2F::TOTP;
use strict;
use Mouse;
use JSON qw(from_json to_json);
use Lemonldap::NG::Portal::Main::Constants qw(
PE_OK
PE_ERROR
PE_BADOTP
PE_F
package Lemonldap::NG::Portal::2F::UTOTP;
use strict;
use Mouse;
use JSON qw(from_json to_json);
use Lemonldap::NG::Portal::Main::Constants qw(
);
our $VERSION = '2.0.16';
extends 'Lemonldap::NG::P
# Get a challenge (from first key)
my $data = eval {
from_json(
$req->data->{crypter}->[0]->authenticationChallenge );
};
Token( $token, __ch => $data->{challenge} );
# Serialize data
$data = to_json( {
challenge => $data->{challenge},
appId =
ssword;
use strict;
use Lemonldap::NG::Portal::Main::Constants 'PE_OK';
use Mouse;
use JSON qw(from_json to_json);
use Lemonldap::NG::Common::Crypto;
our $VERSION = '2.21.0';
extends 'Lemonldap::NG
istration
package Lemonldap::NG::Portal::2F::Register::U2F;
use strict;
use Mouse;
use JSON qw(from_json to_json);
use MIME::Base64 qw(encode_base64url decode_base64url);
our $VERSION = '2.0.16';
e
return [
200,
[
'Content-Type' => 'application/json',
'Content-Length' => length($challenge),
],
[$challenge]
egistration data ($resp)\nget challenge ($challenge)"
);
eval { $challenge = from_json($challenge)->{challenge} };
if ($@) {
$self->userLogger->error(
package Lemonldap::NG::Portal::Issuer::OpenIDConnect;
use strict;
use JSON qw(from_json to_json);
use Lemonldap::NG::Common::JWT qw(getJWTPayload);
use Mouse;
use Lemonldap::NG:
$req->{sessionInfo}->{_oidcConsents} ) {
$_oidcConsents = eval {
from_json( $req->{sessionInfo}->{_oidcConsents},
{ allow_nonref => 1 } );
}
$self->p->updatePersistentSession( $req,
{ _oidcConsents => to_json( \@newoidcConsents ) } );
$self->logger->debug("Consent given for Relying Party
package Lemonldap::NG::Portal::Issuer::OpenID;
use strict;
use JSON;
use Mouse;
use Lemonldap::NG::Common::Regexp;
use Lemonldap::NG::Portal::Main::Constants qw(
PE_OK
PE_ERROR
PE_CONFIRM
PE_
process()
continues, else it returns the error code.
If it is an Ajax request, do() responds in JSON format else it manages
redirection if any. Else it calls
Lemonldap::NG::Portal::Main::Display::di