Commit 13514267 authored by Yadd's avatar Yadd

CAS in progress (#595)

NB: I know that test is broken for now
parent 5ac69452
...@@ -194,14 +194,14 @@ sub run { ...@@ -194,14 +194,14 @@ sub run {
$self->lmLog( "URL $url detected as an CAS LOGOUT URL", 'debug' ); $self->lmLog( "URL $url detected as an CAS LOGOUT URL", 'debug' );
# GET parameters # GET parameters
my $logout_url = $self->param('url'); my $logout_url = $req->param('url');
# Delete linked CAS sessions # Delete linked CAS sessions
$self->deleteCasSecondarySessions($session_id); $self->deleteCasSecondarySessions($session_id);
# Delete local session # Delete local session
unless ( unless (
$self->_deleteSession( $self->p->_deleteSession(
$self->p->getApacheSession( $session_id, 1 ) $self->p->getApacheSession( $session_id, 1 )
) )
) )
......
...@@ -75,7 +75,7 @@ sub _redirect { ...@@ -75,7 +75,7 @@ sub _redirect {
$self->p->sessionDatas, $self->p->sessionDatas,
@{ $self->p->afterDatas }, @{ $self->p->afterDatas },
sub { sub {
return $self->run(@_, @path); return $self->run( @_, @path );
} }
] ]
); );
...@@ -90,7 +90,7 @@ sub _pRedirect { ...@@ -90,7 +90,7 @@ sub _pRedirect {
# Case 3: authentified user, launch # Case 3: authentified user, launch
sub _forAuthUser { sub _forAuthUser {
my ( $self, $req ) = @_; my ( $self, $req, @path ) = @_;
return $self->p->do( return $self->p->do(
$req, $req,
[ [
...@@ -98,7 +98,7 @@ sub _forAuthUser { ...@@ -98,7 +98,7 @@ sub _forAuthUser {
'controlUrl', 'controlUrl',
@{ $self->p->forAuthUser }, @{ $self->p->forAuthUser },
sub { sub {
return $self->run(@_); return $self->run( @_, @path );
}, },
] ]
); );
......
...@@ -7,7 +7,7 @@ BEGIN { ...@@ -7,7 +7,7 @@ BEGIN {
require 't/test-lib.pm'; require 't/test-lib.pm';
} }
my $maintests = 19; my $maintests = 22;
my $debug = 'debug'; my $debug = 'debug';
my ( $issuer, $sp, $res ); my ( $issuer, $sp, $res );
my %handlerOR = ( issuer => [], sp => [] ); my %handlerOR = ( issuer => [], sp => [] );
...@@ -116,7 +116,28 @@ SKIP: { ...@@ -116,7 +116,28 @@ SKIP: {
), ),
'Query SP for logout' 'Query SP for logout'
); );
print STDERR Dumper($res); ok( $res->[0] == 200, 'Response is 200' ) or explain( $res->[0], 200 );
ok(
$res->[2]->[0] =~
m#iframe src="http://auth.idp.com(/cas/logout)\?(.+?)"#s,
'Found iframe'
);
#print STDERR Dumper($res);
# Query IdP with iframe src
$url = $1;
$query = $2;
switch ('issuer');
ok(
$res = $issuer->_get(
$1,
query => $query,
accept => 'text/html',
cookie => "lemonldap=$idpId"
),
'Get iframe from IdP'
);
} }
count($maintests); count($maintests);
......
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