Error using Lemonldap::NG::Common::Crypt
This commit is contained in:
parent
e5bbac08de
commit
7770f58ab2
@ -8,9 +8,8 @@ package Lemonldap::NG::Portal::AuthOpenID;
|
|||||||
|
|
||||||
use strict;
|
use strict;
|
||||||
use Lemonldap::NG::Portal::Simple;
|
use Lemonldap::NG::Portal::Simple;
|
||||||
use Net::OpenID::Consumer;
|
|
||||||
use LWP::UserAgent;
|
use LWP::UserAgent;
|
||||||
use Cache::FileCache;
|
require Cache::FileCache;
|
||||||
|
|
||||||
our $VERSION = '0.1';
|
our $VERSION = '0.1';
|
||||||
|
|
||||||
@ -18,9 +17,9 @@ our $VERSION = '0.1';
|
|||||||
# @return Lemonldap::NG::Portal constant
|
# @return Lemonldap::NG::Portal constant
|
||||||
sub authInit {
|
sub authInit {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
unless ( $self->{openIdSecret} ) {
|
eval { require Net::OpenID::Consumer };
|
||||||
$self->abort( 'Bad configuration', 'openIdSecret field is required' );
|
$self->abort( 'Unable to load Net::OpenID::Consumer', $@ ) if ($@);
|
||||||
}
|
$self->{openIdSecret} ||= $self->{cipher}->encrypt(0);
|
||||||
PE_OK;
|
PE_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -34,7 +33,7 @@ sub extractFormInfo {
|
|||||||
# TODO : LWP options to use a proxy for example
|
# TODO : LWP options to use a proxy for example
|
||||||
$self->{csr} = Net::OpenID::Consumer->new(
|
$self->{csr} = Net::OpenID::Consumer->new(
|
||||||
ua => $ua,
|
ua => $ua,
|
||||||
cache => Cache::FileCache->new,
|
cache => $self->{refLocalStorage} || Cache::FileCache->new,
|
||||||
args => $self,
|
args => $self,
|
||||||
consumer_secret => $self->{openIdSecret},
|
consumer_secret => $self->{openIdSecret},
|
||||||
required_root => $self->{portal},
|
required_root => $self->{portal},
|
||||||
@ -123,8 +122,8 @@ sub setAuthSessionInfo {
|
|||||||
|
|
||||||
$self->{sessionInfo}->{'_user'} = $self->{user};
|
$self->{sessionInfo}->{'_user'} = $self->{user};
|
||||||
|
|
||||||
# authenticationLevel 4 for external authentication
|
# Since OpenID doesn't share authentication level, falling to 1
|
||||||
$self->{sessionInfo}->{authenticationLevel} = 4;
|
$self->{sessionInfo}->{authenticationLevel} = 1;
|
||||||
|
|
||||||
PE_OK;
|
PE_OK;
|
||||||
}
|
}
|
||||||
|
@ -17,7 +17,7 @@ sub issuerDBInit {
|
|||||||
my $self = shift;
|
my $self = shift;
|
||||||
eval { require Net::OpenID::Server };
|
eval { require Net::OpenID::Server };
|
||||||
$self->abort( 'Unable to load Net::OpenID::Server', $@ ) if ($@);
|
$self->abort( 'Unable to load Net::OpenID::Server', $@ ) if ($@);
|
||||||
$self->{openIdSecret} ||= $self->{conf}->crypt(0);
|
$self->{openIdSecret} ||= $self->{cipher}->encrypt(0);
|
||||||
return PE_OK;
|
return PE_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -154,7 +154,7 @@ sub _openIDResponse {
|
|||||||
if ( $self->{_openIdTrustRequired} ) {
|
if ( $self->{_openIdTrustRequired} ) {
|
||||||
|
|
||||||
# TODO
|
# TODO
|
||||||
$self->info( "<h2>Site demandé " . $data->{trust_root} . "</h2>" );
|
$self->info( "<h2>Site demandé " . $data->{trust_root} . "</h2>" );
|
||||||
$self->lmLog( 'OpenID confirmation', 'debug' );
|
$self->lmLog( 'OpenID confirmation', 'debug' );
|
||||||
$self->storeOpenIDprm();
|
$self->storeOpenIDprm();
|
||||||
return PE_CONFIRM;
|
return PE_CONFIRM;
|
||||||
|
Loading…
Reference in New Issue
Block a user