Append option to override Issuer OTT storage (#1993)

2009-display-authentication-error-on-login-form-with-combination-kerberos-ldap
Christophe Maudoux 6 years ago
parent 0182b793a4
commit c01c26af6a
  1. 5
      lemonldap-ng-common/lemonldap-ng.ini
  2. 7
      lemonldap-ng-manager/lib/Lemonldap/NG/Manager/Build/Attributes.pm
  3. 2
      lemonldap-ng-manager/t/80-attributes.t
  4. 19
      lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Main/Issuer.pm
  5. 2
      lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Plugins/Upgrade.pm

@ -305,9 +305,10 @@ languages = en, fr, vi, it, ar, de, fi
; Read Lemonldap::NG::Portal::Main::Plugin(3pm) man page. ; Read Lemonldap::NG::Portal::Main::Plugin(3pm) man page.
;customPlugins = My::Package1, My::Package2 ;customPlugins = My::Package1, My::Package2
; To avoid bad/expired OTT if authssl and auth are served by different Load Balancers ; To avoid bad/expired OTT if "authssl" and "auth" are served by different Load Balancers
; you can override OTT configuration to store Upgrade OTT into global storage ; you can override OTT configuration to store Upgrade or Issuer OTT into global storage
;forceGlobalStorageUpgradeOTT = 1 ;forceGlobalStorageUpgradeOTT = 1
;forceGlobalStorageIssuerOTT = 1
[handler] [handler]

@ -541,6 +541,11 @@ sub attributes {
documentation => documentation =>
'Avoid asking confirmation when an Issuer asks to renew auth', 'Avoid asking confirmation when an Issuer asks to renew auth',
}, },
forceGlobalStorageIssuerOTT => {
type => 'bool',
documentation =>
'Force Issuer tokens be stored into Global Storage',
},
handlerInternalCache => { handlerInternalCache => {
type => 'int', type => 'int',
default => 15, default => 15,
@ -1468,7 +1473,7 @@ sub attributes {
forceGlobalStorageUpgradeOTT => { forceGlobalStorageUpgradeOTT => {
type => 'bool', type => 'bool',
documentation => documentation =>
'Force upgrade tokens be stored into Global Storage', 'Force Upgrade tokens be stored into Global Storage',
}, },
# 2F # 2F

@ -56,7 +56,7 @@ my @notManagedAttributes = (
'max2FDevices', 'max2FDevicesNameLength', 'checkTime', 'max2FDevices', 'max2FDevicesNameLength', 'checkTime',
'mySessionAuthorizedRWKeys', 'handlerInternalCache', 'mySessionAuthorizedRWKeys', 'handlerInternalCache',
'handlerServiceTokenTTL', 'impersonationPrefix', 'pdataDomain', 'handlerServiceTokenTTL', 'impersonationPrefix', 'pdataDomain',
'forceGlobalStorageUpgradeOTT' 'forceGlobalStorageUpgradeOTT', 'forceGlobalStorageIssuerOTT'
); );
# Words used either as attribute name and node title # Words used either as attribute name and node title

@ -20,17 +20,14 @@ use Lemonldap::NG::Portal::Main::Constants qw(
extends 'Lemonldap::NG::Portal::Main::Plugin'; extends 'Lemonldap::NG::Portal::Main::Plugin';
our $VERSION = '2.0.6'; our $VERSION = '2.0.7';
# PROPERTIES # PROPERTIES
has type => ( is => 'rw' ); has type => ( is => 'rw' );
has path => ( is => 'rw' );
has path => ( is => 'rw' );
has ipath => ( is => 'rw' ); has ipath => ( is => 'rw' );
has _ott => (
has _ott => (
is => 'rw', is => 'rw',
lazy => 1, lazy => 1,
default => sub { default => sub {
@ -52,6 +49,12 @@ sub beforeLogout { 'logout' }
sub init { sub init {
my ($self) = @_; my ($self) = @_;
if ( $self->conf->{forceGlobalStorageIssuerOTT} ) {
$self->logger->debug(
"-> Issuer tokens will be stored into global storage");
$self->_ott->cache(undef);
}
my $type = ref( $_[0] ); my $type = ref( $_[0] );
$type =~ s/.*:://; $type =~ s/.*:://;
$self->type($type); $self->type($type);
@ -91,7 +94,7 @@ sub _redirect {
'Add ' . $self->ipath . ', ' . $self->ipath . 'Path in keepPdata' ); 'Add ' . $self->ipath . ', ' . $self->ipath . 'Path in keepPdata' );
push @{ $req->pdata->{keepPdata} }, $self->ipath, $self->ipath . 'Path'; push @{ $req->pdata->{keepPdata} }, $self->ipath, $self->ipath . 'Path';
$req->{urldc} = $self->conf->{portal} . '/' . $self->path; $req->{urldc} = $self->conf->{portal} . '/' . $self->path;
$req->pdata->{_url} = encode_base64($req->urldc, ''); $req->pdata->{_url} = encode_base64( $req->urldc, '' );
} }
else { else {
$self->logger->debug('Not seen as Issuer request, skipping'); $self->logger->debug('Not seen as Issuer request, skipping');

@ -29,7 +29,7 @@ sub init {
my ($self) = @_; my ($self) = @_;
if ( $self->conf->{forceGlobalStorageUpgradeOTT} ) { if ( $self->conf->{forceGlobalStorageUpgradeOTT} ) {
$self->logger->debug( $self->logger->debug(
"Upgrade token will be stored into global storage"); "-> Upgrade tokens will be stored into global storage");
$self->ott->cache(undef); $self->ott->cache(undef);
} }
$self->addAuthRoute( upgradesession => 'ask', ['GET'] ); $self->addAuthRoute( upgradesession => 'ask', ['GET'] );

Loading…
Cancel
Save