Commit 4b1cad20 authored by Xavier Guimard's avatar Xavier Guimard

Add CDA test (portal part) (#1440)

parent 0485c4aa
......@@ -430,6 +430,7 @@ t/62-SingleSession.t
t/63-History.t
t/64-StayConnected.t
t/65-AutoSignin.t
t/66-CDA.t
t/70-2F-TOTP.t
t/71-2F-U2F.t
t/72-2F-REST.t
......
use Test::More;
use strict;
use IO::String;
use Lemonldap::NG::Portal::Main::Constants qw(
PE_FIRSTACCESS
);
require 't/test-lib.pm';
my $res;
my $client = LLNG::Manager::Test->new(
{
ini => {
logLevel => 'error',
useSafeJail => 1,
cda => 1
}
}
);
# CDA with unauthentified user
ok(
$res = $client->_get(
'/',
query => 'url=aHR0cDovL3Rlc3QuZXhhbXBsZS5vcmcv',
accept => 'text/html',
),
'Unauth CDA request'
);
my ( $host, $url, $query ) = expectForm( $res, undef, undef, 'url' );
ok( $query =~ /\burl=aHR0cDovL3Rlc3QuZXhhbXBsZS5vcmcv\b/, ' check url value' );
count(2);
# Authentification
$query .= '&user=dwho&password=dwho';
ok(
$res = $client->_post(
'/' => IO::String->new($query),
length => length($query),
accept => 'text/html',
),
'Post credentials'
);
count(1);
($query) = expectRedirection( $res, qr#^http://test.example.org/\?(lemonldapcda=.*)$# );
clean_sessions();
done_testing( count() );
......@@ -48,6 +48,9 @@
"test2.example.com": {
"^/logout": "logout_sso",
"default": "accept"
},
"test.example.org": {
"default": "accept"
}
},
"macros": {
......
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