Avoid session conflict between Issuer and Auth CAS (#1468)
This commit is contained in:
parent
ece95d3da2
commit
a5cc73a54c
|
@ -20,6 +20,7 @@ extends 'Lemonldap::NG::Portal::Main::Auth', 'Lemonldap::NG::Portal::Lib::CAS';
|
|||
|
||||
has srvNumber => ( is => 'rw', default => 0 );
|
||||
has srvList => ( is => 'rw', default => sub { [] } );
|
||||
use constant sessionKind => 'CAS';
|
||||
|
||||
# INITIALIZATION
|
||||
|
||||
|
|
|
@ -21,6 +21,7 @@ extends 'Lemonldap::NG::Portal::Main::Issuer',
|
|||
# INITIALIZATION
|
||||
|
||||
use constant beforeAuth => 'storeEnvAndCheckGateway';
|
||||
use constant sessionKind => 'ICAS';
|
||||
|
||||
sub init {
|
||||
my ($self) = @_;
|
||||
|
|
|
@ -106,7 +106,7 @@ sub getCasSession {
|
|||
cacheModule => $self->conf->{localSessionStorage},
|
||||
cacheModuleOptions => $self->conf->{localSessionStorageOptions},
|
||||
id => $id,
|
||||
kind => "CAS",
|
||||
kind => $self->sessionKind,
|
||||
( $info ? ( info => $info ) : () ),
|
||||
}
|
||||
);
|
||||
|
@ -255,7 +255,12 @@ sub deleteCasSecondarySessions {
|
|||
my $cas_sessions =
|
||||
$module->searchOn( $moduleOptions, "_cas_id", $session_id );
|
||||
|
||||
if ( my @cas_sessions_keys = keys %$cas_sessions ) {
|
||||
if (
|
||||
my @cas_sessions_keys =
|
||||
grep { $cas_sessions->{$_}->{_session_kind} eq $self->sessionKind }
|
||||
keys %$cas_sessions
|
||||
)
|
||||
{
|
||||
|
||||
foreach my $cas_session (@cas_sessions_keys) {
|
||||
|
||||
|
@ -404,7 +409,13 @@ sub validateST {
|
|||
my $pgtIdSessions =
|
||||
$module->searchOn( $moduleOptions, "pgtIou", $pgtIou );
|
||||
|
||||
foreach my $id ( keys %$pgtIdSessions ) {
|
||||
foreach my $id (
|
||||
grep {
|
||||
$pgtIdSessions->{$_}->{_session_kind} eq $self->sessionKind
|
||||
}
|
||||
keys %$pgtIdSessions
|
||||
)
|
||||
{
|
||||
|
||||
# There should be only on session
|
||||
my $pgtIdSession = $self->getCasSession($id) or next;
|
||||
|
|
Loading…
Reference in New Issue
Block a user