Commit 3d23dc27 authored by Yadd's avatar Yadd

CAS in progress (#595)

parent 72814818
......@@ -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( {} );
}
......
......@@ -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;
}
......
......@@ -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' );
......
......@@ -133,7 +133,6 @@ sub deleteSession {
return PE_ERROR;
}
else {
HANDLER->localUnlog( $req->id );
$self->lmLog( "Session $req->{id} deleted from global storage",
'debug' );
}
......
......@@ -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' );
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment