Fix partially #1422
This commit is contained in:
parent
80c76b18d8
commit
86283952b0
|
@ -16,10 +16,6 @@ our $VERSION = '2.0.0';
|
||||||
extends 'Lemonldap::NG::Portal::Main::Issuer',
|
extends 'Lemonldap::NG::Portal::Main::Issuer',
|
||||||
'Lemonldap::NG::Portal::Lib::CAS';
|
'Lemonldap::NG::Portal::Lib::CAS';
|
||||||
|
|
||||||
# INTERFACE
|
|
||||||
|
|
||||||
sub beforeAuth { 'exportRequestParameters' }
|
|
||||||
|
|
||||||
# INITIALIZATION
|
# INITIALIZATION
|
||||||
|
|
||||||
sub init {
|
sub init {
|
||||||
|
@ -84,7 +80,11 @@ sub run {
|
||||||
my $casServiceTicket;
|
my $casServiceTicket;
|
||||||
|
|
||||||
# Renew
|
# Renew
|
||||||
if ( $renew and $renew eq 'true' ) {
|
if ( $renew
|
||||||
|
and $renew eq 'true'
|
||||||
|
and time - $req->sessionInfo->{_utime} >
|
||||||
|
$self->conf->{portalForceAuthnInterval} )
|
||||||
|
{
|
||||||
|
|
||||||
# Authentication must be replayed
|
# Authentication must be replayed
|
||||||
$self->logger->debug("Authentication renew requested");
|
$self->logger->debug("Authentication renew requested");
|
||||||
|
@ -707,17 +707,4 @@ sub _validate2 {
|
||||||
$casProxyGrantingTicketIOU, $proxies, $attributes );
|
$casProxyGrantingTicketIOU, $proxies, $attributes );
|
||||||
}
|
}
|
||||||
|
|
||||||
# Store request parameters in %ENV
|
|
||||||
sub exportRequestParameters {
|
|
||||||
my ( $self, $req ) = @_;
|
|
||||||
|
|
||||||
foreach my $param (qw/service renew gateway/) {
|
|
||||||
if ( $req->param($param) ) {
|
|
||||||
$req->env->{ "llng_cas_" . $param } = $req->param($param);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return PE_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
1;
|
1;
|
||||||
|
|
|
@ -132,6 +132,7 @@ SKIP: {
|
||||||
|
|
||||||
# Back to SP
|
# Back to SP
|
||||||
switch ('sp');
|
switch ('sp');
|
||||||
|
|
||||||
# Follow redirection to CAS app
|
# Follow redirection to CAS app
|
||||||
ok(
|
ok(
|
||||||
$res = $sp->_get(
|
$res = $sp->_get(
|
||||||
|
@ -216,11 +217,12 @@ SKIP: {
|
||||||
'Follow redirection'
|
'Follow redirection'
|
||||||
|
|
||||||
);
|
);
|
||||||
($query) = expectRedirection($res,qr#http://auth.sp.com/?\?(ticket=.*)$#);
|
($query) =
|
||||||
|
expectRedirection( $res, qr#http://auth.sp.com/?\?(ticket=.*)$# );
|
||||||
|
|
||||||
# Follow redirection to CAS app
|
# Follow redirection to CAS app
|
||||||
switch ('sp');
|
switch ('sp');
|
||||||
ok($res=$sp->_get('/',query => $query),'Follow redirection');
|
ok( $res = $sp->_get( '/', query => $query ), 'Follow redirection' );
|
||||||
|
|
||||||
expectCookie($res);
|
expectCookie($res);
|
||||||
|
|
||||||
|
@ -313,18 +315,19 @@ sub issuer {
|
||||||
demo => 'Demo;Demo;Demo',
|
demo => 'Demo;Demo;Demo',
|
||||||
sql => 'DBI;DBI;DBI',
|
sql => 'DBI;DBI;DBI',
|
||||||
},
|
},
|
||||||
dbiAuthChain => 'dbi:SQLite:dbname=t/userdb.db',
|
dbiAuthChain => 'dbi:SQLite:dbname=t/userdb.db',
|
||||||
dbiAuthUser => '',
|
dbiAuthUser => '',
|
||||||
dbiAuthPassword => '',
|
dbiAuthPassword => '',
|
||||||
dbiAuthTable => 'users',
|
dbiAuthTable => 'users',
|
||||||
dbiAuthLoginCol => 'user',
|
dbiAuthLoginCol => 'user',
|
||||||
dbiAuthPasswordCol => 'password',
|
dbiAuthPasswordCol => 'password',
|
||||||
dbiAuthPasswordHash => '',
|
dbiAuthPasswordHash => '',
|
||||||
issuerDBCASActivation => 1,
|
issuerDBCASActivation => 1,
|
||||||
casAttr => 'uid',
|
casAttr => 'uid',
|
||||||
casAttributes => { cn => 'cn', uid => 'uid', },
|
casAttributes => { cn => 'cn', uid => 'uid', },
|
||||||
casAccessControlPolicy => 'none',
|
casAccessControlPolicy => 'none',
|
||||||
multiValuesSeparator => ';',
|
multiValuesSeparator => ';',
|
||||||
|
portalForceAuthnInterval => -1,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user