Use base64 URL to decode JWT (#2045)
This commit is contained in:
parent
2a4392b1ec
commit
ae0d455e7f
|
@ -9,7 +9,7 @@ use Lemonldap::NG::Portal::Main::Constants qw(
|
|||
PE_OK
|
||||
);
|
||||
|
||||
our $VERSION = '2.0.4';
|
||||
our $VERSION = '2.0.7';
|
||||
|
||||
extends 'Lemonldap::NG::Portal::Main::Auth',
|
||||
'Lemonldap::NG::Portal::Lib::OpenIDConnect';
|
||||
|
@ -186,7 +186,7 @@ sub extractFormInfo {
|
|||
my $id_token_payload = $self->extractJWT($id_token)->[1];
|
||||
|
||||
my $id_token_payload_hash =
|
||||
$self->decodeJSON( decode_base64($id_token_payload) );
|
||||
$self->decodeJSON( $self->decodeBase64url($id_token_payload) );
|
||||
|
||||
# Check validity of Access Token (optional)
|
||||
my $at_hash = $id_token_payload_hash->{at_hash};
|
||||
|
@ -243,7 +243,7 @@ sub extractFormInfo {
|
|||
my $portalPath = $self->{conf}->{portal};
|
||||
$portalPath =~ s#^https?://[^/]+/?#/#;
|
||||
|
||||
$req->data->{list} = $self->opList;
|
||||
$req->data->{list} = $self->opList;
|
||||
|
||||
$req->data->{login} = 1;
|
||||
return PE_IDPCHOICE;
|
||||
|
|
|
@ -19,7 +19,7 @@ use Mouse;
|
|||
|
||||
use Lemonldap::NG::Portal::Main::Constants qw(PE_OK PE_REDIRECT);
|
||||
|
||||
our $VERSION = '2.0.6';
|
||||
our $VERSION = '2.0.7';
|
||||
|
||||
# OpenID Connect standard claims
|
||||
use constant PROFILE => [
|
||||
|
@ -1633,6 +1633,16 @@ sub decode_base64url {
|
|||
return decode_base64($s);
|
||||
}
|
||||
|
||||
sub encodeBase64url {
|
||||
my ( $self, $value ) = @_;
|
||||
return encode_base64url($value);
|
||||
}
|
||||
|
||||
sub decodeBase64url {
|
||||
my ( $self, $value ) = @_;
|
||||
return decode_base64url($value);
|
||||
}
|
||||
|
||||
sub addRouteFromConf {
|
||||
my ( $self, $type, %subs ) = @_;
|
||||
my $adder = "add${type}Route";
|
||||
|
|
Loading…
Reference in New Issue
Block a user