CAS in progress (#595)

This commit is contained in:
Xavier Guimard 2016-12-22 22:06:13 +00:00
parent 7281481802
commit 3d23dc272d
5 changed files with 9 additions and 8 deletions

View File

@ -614,7 +614,7 @@ sub localUnlog {
if ( $id //= $class->fetchId ) {
# Delete thread datas
if ( $id eq $class->datas->{_session_id} ) {
if ( $class->datas and $id eq $class->datas->{_session_id} ) {
$class->datas( {} );
}

View File

@ -190,7 +190,7 @@ sub authenticate {
# Set authenticationLevel.
sub setAuthSessionInfo {
my ( $self, $req ) = @_;
$req->{sessionInfo}->{authenticationLevel} = $self->{CASauthnLevel};
$req->{sessionInfo}->{authenticationLevel} = $self->conf->{CASAuthnLevel};
PE_OK;
}

View File

@ -73,7 +73,7 @@ sub run {
my $casServiceTicket;
# Renew
if ( $renew eq 'true' ) {
if ( $renew and $renew eq 'true' ) {
# Authentication must be replayed
$self->lmLog( "Authentication renew requested", 'debug' );
@ -136,7 +136,8 @@ sub run {
my $casRenewFlag = 0;
my $last_authn_utime = $self->{sessionInfo}->{_lastAuthnUTime} || 0;
if (
time() - $last_authn_utime < $self->{portalForceAuthnInterval} )
time() - $last_authn_utime <
$self->conf->{portalForceAuthnInterval} )
{
$self->lmLog(
"Authentication is recent, will set CAS renew flag to true",
@ -367,7 +368,7 @@ sub validate {
}
# Check renew
if ( $renew eq 'true' ) {
if ( $renew and $renew eq 'true' ) {
# We should check the ST was delivered with primary credentials
$self->lmLog( "Renew flag detected ", 'debug' );
@ -511,7 +512,7 @@ sub _validate2 {
}
# Check renew
if ( $renew eq 'true' ) {
if ( $renew and $renew eq 'true' ) {
# We should check the ST was delivered with primary credentials
$self->lmLog( "Renew flag detected ", 'debug' );

View File

@ -133,7 +133,6 @@ sub deleteSession {
return PE_ERROR;
}
else {
HANDLER->localUnlog( $req->id );
$self->lmLog( "Session $req->{id} deleted from global storage",
'debug' );
}

View File

@ -8,7 +8,7 @@ BEGIN {
}
my $maintests = 24;
my $debug = 'debug';
my $debug = 'error';
my ( $issuer, $sp, $res );
my %handlerOR = ( issuer => [], sp => [] );
@ -20,6 +20,7 @@ SKIP: {
skip 'AuthCAS not found', $maintests;
}
no warnings 'once';
*AuthCAS::get_https2 = *mygethttps2;
ok( $issuer = issuer(), 'Issuer portal' );