2018-09-05 22:24:23 +02:00
|
|
|
use lib 'inc';
|
2016-12-31 09:39:31 +01:00
|
|
|
use Test::More;
|
|
|
|
use strict;
|
|
|
|
use IO::String;
|
2018-04-09 22:56:14 +02:00
|
|
|
use LWP::UserAgent;
|
2018-09-05 22:24:23 +02:00
|
|
|
use LWP::Protocol::PSGI;
|
2016-12-31 09:39:31 +01:00
|
|
|
use MIME::Base64;
|
|
|
|
|
|
|
|
BEGIN {
|
|
|
|
require 't/test-lib.pm';
|
|
|
|
}
|
|
|
|
|
2018-05-07 18:01:52 +02:00
|
|
|
my $debug = 'error';
|
2017-01-02 21:35:37 +01:00
|
|
|
my ( $op, $rp, $res );
|
|
|
|
my %handlerOR = ( op => [], rp => [] );
|
2016-12-31 09:39:31 +01:00
|
|
|
|
2018-05-05 21:17:54 +02:00
|
|
|
my $access_token;
|
|
|
|
|
2018-04-09 22:56:14 +02:00
|
|
|
LWP::Protocol::PSGI->register(
|
|
|
|
sub {
|
|
|
|
my $req = Plack::Request->new(@_);
|
|
|
|
ok( $req->uri =~ m#http://auth.((?:o|r)p).com(.*)#, ' REST request' );
|
|
|
|
my $host = $1;
|
|
|
|
my $url = $2;
|
|
|
|
my ( $res, $client );
|
|
|
|
count(1);
|
|
|
|
if ( $host eq 'op' ) {
|
|
|
|
pass(" Request from RP to OP, endpoint $url");
|
|
|
|
$client = $op;
|
|
|
|
}
|
|
|
|
elsif ( $host eq 'rp' ) {
|
|
|
|
pass(' Request from OP to RP');
|
|
|
|
$client = $rp;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
fail(' Aborting REST request (external)');
|
|
|
|
return [ 500, [], [] ];
|
|
|
|
}
|
|
|
|
if ( $req->method =~ /^post$/i ) {
|
|
|
|
my $s = $req->content;
|
|
|
|
ok(
|
|
|
|
$res = $client->_post(
|
|
|
|
$url, IO::String->new($s),
|
|
|
|
length => length($s),
|
|
|
|
type => $req->header('Content-Type'),
|
|
|
|
),
|
|
|
|
' Execute request'
|
|
|
|
);
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
ok(
|
|
|
|
$res = $client->_get(
|
|
|
|
$url,
|
|
|
|
custom => {
|
|
|
|
HTTP_AUTHORIZATION => $req->header('Authorization'),
|
|
|
|
}
|
|
|
|
),
|
|
|
|
' Execute request'
|
|
|
|
);
|
|
|
|
}
|
|
|
|
ok( $res->[0] == 200, ' Response is 200' );
|
|
|
|
ok( getHeader( $res, 'Content-Type' ) =~ m#^application/json#,
|
|
|
|
' Content is JSON' )
|
|
|
|
or explain( $res->[1], 'Content-Type => application/json' );
|
|
|
|
count(4);
|
2018-05-05 21:17:54 +02:00
|
|
|
if ( $res->[2]->[0] =~ /"access_token":"(.*?)"/ ) {
|
|
|
|
$access_token = $1;
|
|
|
|
pass "Found access_token $access_token";
|
|
|
|
count(1);
|
|
|
|
}
|
2018-04-09 22:56:14 +02:00
|
|
|
return $res;
|
|
|
|
}
|
|
|
|
);
|
|
|
|
|
2016-12-31 09:39:31 +01:00
|
|
|
# Initialization
|
2017-01-02 21:35:37 +01:00
|
|
|
ok( $op = op(), 'OP portal' );
|
2016-12-31 09:39:31 +01:00
|
|
|
|
2017-01-02 21:35:37 +01:00
|
|
|
ok( $res = $op->_get('/oauth2/jwks'), 'Get JWKS, endpoint /oauth2/jwks' );
|
2017-01-24 22:02:06 +01:00
|
|
|
expectOK($res);
|
2016-12-31 15:40:26 +01:00
|
|
|
my $jwks = $res->[2]->[0];
|
|
|
|
|
2017-01-02 21:20:42 +01:00
|
|
|
ok(
|
2017-01-02 21:35:37 +01:00
|
|
|
$res = $op->_get('/.well-known/openid-configuration'),
|
2017-01-02 21:20:42 +01:00
|
|
|
'Get metadata, endpoint /.well-known/openid-configuration'
|
|
|
|
);
|
2017-01-24 22:02:06 +01:00
|
|
|
expectOK($res);
|
2016-12-31 15:40:26 +01:00
|
|
|
my $metadata = $res->[2]->[0];
|
|
|
|
count(3);
|
2016-12-31 14:08:39 +01:00
|
|
|
|
2017-01-02 21:35:37 +01:00
|
|
|
switch ('rp');
|
2018-06-05 23:13:18 +02:00
|
|
|
&Lemonldap::NG::Handler::Main::cfgNum( 0, 0 );
|
2017-01-02 21:35:37 +01:00
|
|
|
ok( $rp = rp( $jwks, $metadata ), 'RP portal' );
|
2016-12-31 14:08:39 +01:00
|
|
|
count(1);
|
|
|
|
|
2017-01-01 10:43:48 +01:00
|
|
|
# Query RP for auth
|
2017-01-02 21:35:37 +01:00
|
|
|
ok( $res = $rp->_get( '/', accept => 'text/html' ), 'Unauth SP request' );
|
2017-01-01 10:43:48 +01:00
|
|
|
count(1);
|
|
|
|
my ( $url, $query ) =
|
|
|
|
expectRedirection( $res, qr#http://auth.op.com(/oauth2/authorize)\?(.*)$# );
|
|
|
|
|
|
|
|
# Push request to OP
|
2017-01-02 21:35:37 +01:00
|
|
|
switch ('op');
|
|
|
|
ok( $res = $op->_get( $url, query => $query, accept => 'text/html' ),
|
2017-01-02 21:57:45 +01:00
|
|
|
"Push request to OP, endpoint $url" );
|
2017-01-01 10:43:48 +01:00
|
|
|
count(1);
|
|
|
|
expectOK($res);
|
|
|
|
|
2017-03-14 22:55:47 +01:00
|
|
|
# Try to authenticate to OP
|
2017-03-02 21:52:12 +01:00
|
|
|
$query = "user=french&password=french&$query";
|
2017-01-01 10:43:48 +01:00
|
|
|
ok(
|
2017-01-02 21:35:37 +01:00
|
|
|
$res = $op->_post(
|
2017-01-01 10:43:48 +01:00
|
|
|
$url,
|
|
|
|
IO::String->new($query),
|
|
|
|
accept => 'text/html',
|
|
|
|
length => length($query),
|
|
|
|
),
|
2017-01-02 21:57:45 +01:00
|
|
|
"Post authentication, endpoint $url"
|
2017-01-01 10:43:48 +01:00
|
|
|
);
|
|
|
|
count(1);
|
|
|
|
my $idpId = expectCookie($res);
|
|
|
|
my ( $host, $tmp );
|
2017-01-02 21:20:42 +01:00
|
|
|
( $host, $tmp, $query ) = expectForm( $res, '#', undef, 'confirm' );
|
2017-01-01 10:43:48 +01:00
|
|
|
|
|
|
|
ok(
|
2017-01-02 21:35:37 +01:00
|
|
|
$res = $op->_post(
|
2017-01-01 10:43:48 +01:00
|
|
|
$url,
|
|
|
|
IO::String->new($query),
|
|
|
|
accept => 'text/html',
|
|
|
|
cookie => "lemonldap=$idpId",
|
|
|
|
length => length($query),
|
|
|
|
),
|
2017-01-02 21:57:45 +01:00
|
|
|
"Post confirmation, endpoint $url"
|
2017-01-01 10:43:48 +01:00
|
|
|
);
|
|
|
|
count(1);
|
|
|
|
|
|
|
|
($query) = expectRedirection( $res, qr#^http://auth.rp.com/?\?(.*)$# );
|
2017-03-27 18:51:18 +02:00
|
|
|
|
2017-01-01 10:43:48 +01:00
|
|
|
# Push OP response to RP
|
2017-01-02 21:35:37 +01:00
|
|
|
switch ('rp');
|
2017-01-01 10:43:48 +01:00
|
|
|
|
2017-01-02 21:35:37 +01:00
|
|
|
ok( $res = $rp->_get( '/', query => $query, accept => 'text/html' ),
|
2017-01-01 10:43:48 +01:00
|
|
|
'Call openidconnectcallback on RP' );
|
|
|
|
count(1);
|
2017-01-01 18:56:46 +01:00
|
|
|
my $spId = expectCookie($res);
|
|
|
|
|
2017-01-02 21:35:37 +01:00
|
|
|
switch ('op');
|
2017-01-02 21:57:45 +01:00
|
|
|
ok(
|
2017-01-04 23:19:17 +01:00
|
|
|
$res = $op->_get( '/oauth2/checksession.html', accept => 'text.html' ),
|
|
|
|
'Check session, endpoint /oauth2/checksession.html'
|
2017-01-02 21:57:45 +01:00
|
|
|
);
|
2017-01-02 21:20:42 +01:00
|
|
|
count(1);
|
2017-01-02 21:57:45 +01:00
|
|
|
expectOK($res);
|
2017-01-21 10:50:59 +01:00
|
|
|
ok( getHeader( $res, 'Content-Security-Policy' ) !~ /frame-ancestors/,
|
2017-01-21 10:17:24 +01:00
|
|
|
' Frame can be embedded' )
|
|
|
|
or explain( $res->[1],
|
2017-01-21 10:50:59 +01:00
|
|
|
'Content-Security-Policy does not contain a frame-ancestors' );
|
2017-01-20 07:19:54 +01:00
|
|
|
count(1);
|
2017-01-02 21:20:42 +01:00
|
|
|
|
2017-03-02 21:52:12 +01:00
|
|
|
# Verify UTF-8
|
2018-05-05 21:17:54 +02:00
|
|
|
ok(
|
|
|
|
$res = $op->_get(
|
2018-06-21 21:35:16 +02:00
|
|
|
'/oauth2/userinfo', query => 'access_token=' . $access_token,
|
2018-05-05 21:17:54 +02:00
|
|
|
),
|
|
|
|
'Get userinfo'
|
|
|
|
);
|
2019-10-25 16:41:34 +02:00
|
|
|
$res = expectJSON($res);
|
2018-05-05 21:17:54 +02:00
|
|
|
ok( $res->{name} eq 'Frédéric Accents', 'UTF-8 values' )
|
|
|
|
or explain( $res, 'name => Frédéric Accents' );
|
2019-10-25 16:41:34 +02:00
|
|
|
count(2);
|
2018-05-05 21:17:54 +02:00
|
|
|
|
|
|
|
ok( $res = $op->_get("/sessions/global/$spId"), 'Get UTF-8' );
|
2019-10-25 16:41:34 +02:00
|
|
|
$res = expectJSON($res);
|
2018-05-05 21:17:54 +02:00
|
|
|
ok( $res->{cn} eq 'Frédéric Accents', 'UTF-8 values' )
|
|
|
|
or explain( $res, 'cn => Frédéric Accents' );
|
2019-10-25 16:41:34 +02:00
|
|
|
count(2);
|
2018-05-05 21:17:54 +02:00
|
|
|
|
2017-01-02 21:35:37 +01:00
|
|
|
switch ('rp');
|
2017-03-02 21:52:12 +01:00
|
|
|
ok( $res = $rp->_get("/sessions/global/$spId"), 'Get UTF-8' );
|
2019-10-25 16:41:34 +02:00
|
|
|
$res = expectJSON($res);
|
2017-03-02 21:52:12 +01:00
|
|
|
ok( $res->{cn} eq 'Frédéric Accents', 'UTF-8 values' )
|
|
|
|
or explain( $res, 'cn => Frédéric Accents' );
|
2019-10-25 16:41:34 +02:00
|
|
|
count(2);
|
2017-03-02 21:52:12 +01:00
|
|
|
|
|
|
|
# Logout initiated by RP
|
2017-01-01 18:56:46 +01:00
|
|
|
ok(
|
2017-01-02 21:35:37 +01:00
|
|
|
$res = $rp->_get(
|
2017-01-01 18:56:46 +01:00
|
|
|
'/',
|
|
|
|
query => 'logout',
|
|
|
|
cookie => "lemonldap=$spId",
|
|
|
|
accept => 'text/html'
|
|
|
|
),
|
2017-03-21 11:29:21 +01:00
|
|
|
'Query RP for logout'
|
2017-01-01 18:56:46 +01:00
|
|
|
);
|
|
|
|
count(1);
|
|
|
|
( $url, $query ) = expectRedirection( $res,
|
|
|
|
qr#http://auth.op.com(/oauth2/logout)\?(post_logout_redirect_uri=.+)$# );
|
|
|
|
|
|
|
|
# Push logout to OP
|
2017-01-02 21:35:37 +01:00
|
|
|
switch ('op');
|
2017-01-01 18:56:46 +01:00
|
|
|
|
|
|
|
ok(
|
2017-01-02 21:35:37 +01:00
|
|
|
$res = $op->_get(
|
2017-01-01 18:56:46 +01:00
|
|
|
$url,
|
|
|
|
query => $query,
|
|
|
|
cookie => "lemonldap=$idpId",
|
|
|
|
accept => 'text/html'
|
|
|
|
),
|
2017-01-02 21:57:45 +01:00
|
|
|
"Push logout request to OP, endpoint $url"
|
2017-01-01 18:56:46 +01:00
|
|
|
);
|
|
|
|
count(1);
|
|
|
|
|
|
|
|
( $host, $tmp, $query ) = expectForm( $res, '#', undef, 'confirm' );
|
|
|
|
|
|
|
|
ok(
|
2017-01-02 21:35:37 +01:00
|
|
|
$res = $op->_post(
|
2017-01-01 18:56:46 +01:00
|
|
|
$url, IO::String->new($query),
|
|
|
|
length => length($query),
|
|
|
|
cookie => "lemonldap=$idpId",
|
2017-06-12 21:10:37 +02:00
|
|
|
accept => 'text/html',
|
2017-01-01 18:56:46 +01:00
|
|
|
),
|
2017-01-02 21:57:45 +01:00
|
|
|
"Confirm logout, endpoint $url"
|
|
|
|
);
|
|
|
|
count(1);
|
|
|
|
|
2017-06-12 21:10:37 +02:00
|
|
|
( $url, $query ) = expectRedirection( $res, qr#.# );
|
|
|
|
|
2019-11-06 18:38:58 +01:00
|
|
|
my $removedCookie = expectCookie($res);
|
|
|
|
is($removedCookie, 0, "SSO cookie removed");
|
|
|
|
count(1);
|
|
|
|
|
2017-01-02 21:57:45 +01:00
|
|
|
# Test logout endpoint without session
|
|
|
|
ok(
|
|
|
|
$res = $op->_get(
|
|
|
|
'/oauth2/logout',
|
|
|
|
accept => 'text/html',
|
2017-06-12 21:10:37 +02:00
|
|
|
query => 'post_logout_redirect_uri=http://auth.rp.com/?logout=1'
|
2017-01-02 21:57:45 +01:00
|
|
|
),
|
|
|
|
'logout endpoint with redirect, endpoint /oauth2/logout'
|
2017-01-01 18:56:46 +01:00
|
|
|
);
|
|
|
|
count(1);
|
2017-06-12 21:10:37 +02:00
|
|
|
expectRedirection( $res, 'http://auth.rp.com/?logout=1' );
|
2017-01-02 21:57:45 +01:00
|
|
|
|
|
|
|
ok( $res = $op->_get('/oauth2/logout'),
|
|
|
|
'logout endpoint, endpoint /oauth2/logout' );
|
|
|
|
count(1);
|
|
|
|
expectReject($res);
|
2017-01-01 18:56:46 +01:00
|
|
|
|
2017-01-02 21:20:42 +01:00
|
|
|
# Test if logout is done
|
|
|
|
ok(
|
2017-01-02 21:35:37 +01:00
|
|
|
$res = $op->_get(
|
2017-01-02 21:20:42 +01:00
|
|
|
'/', cookie => "lemonldap=$idpId",
|
|
|
|
),
|
|
|
|
'Test if user is reject on IdP'
|
|
|
|
);
|
|
|
|
count(1);
|
|
|
|
expectReject($res);
|
2017-01-01 18:56:46 +01:00
|
|
|
|
2017-01-02 21:35:37 +01:00
|
|
|
switch ('rp');
|
2017-01-02 21:20:42 +01:00
|
|
|
ok(
|
2017-01-02 21:35:37 +01:00
|
|
|
$res = $rp->_get(
|
2017-01-02 21:20:42 +01:00
|
|
|
'/',
|
|
|
|
accept => 'text/html',
|
2019-10-01 11:18:20 +02:00
|
|
|
cookie => "lemonldap=$spId"
|
2017-01-02 21:20:42 +01:00
|
|
|
),
|
|
|
|
'Test if user is reject on SP'
|
|
|
|
);
|
|
|
|
count(1);
|
2017-10-31 13:04:05 +01:00
|
|
|
( $url, $query ) =
|
|
|
|
expectRedirection( $res, qr#^http://auth.op.com(/oauth2/authorize)\?(.*)$# );
|
|
|
|
|
|
|
|
# Test if consent was saved
|
|
|
|
# -------------------------
|
|
|
|
|
|
|
|
# Push request to OP
|
|
|
|
switch ('op');
|
|
|
|
ok( $res = $op->_get( $url, query => $query, accept => 'text/html' ),
|
|
|
|
"Push request to OP, endpoint $url" );
|
|
|
|
count(1);
|
|
|
|
expectOK($res);
|
|
|
|
|
|
|
|
# Try to authenticate to OP
|
|
|
|
$query = "user=french&password=french&$query";
|
|
|
|
ok(
|
|
|
|
$res = $op->_post(
|
|
|
|
$url,
|
|
|
|
IO::String->new($query),
|
|
|
|
accept => 'text/html',
|
|
|
|
length => length($query),
|
|
|
|
),
|
|
|
|
"Post authentication, endpoint $url"
|
|
|
|
);
|
|
|
|
count(1);
|
|
|
|
$idpId = expectCookie($res);
|
2018-09-02 17:31:58 +02:00
|
|
|
|
2018-07-19 23:39:58 +02:00
|
|
|
#expectRedirection( $res, qr#^http://auth.rp.com/# );
|
2017-01-02 21:20:42 +01:00
|
|
|
|
2017-01-01 18:56:46 +01:00
|
|
|
#print STDERR Dumper($res);
|
2016-12-31 14:08:39 +01:00
|
|
|
|
2016-12-31 09:39:31 +01:00
|
|
|
clean_sessions();
|
|
|
|
done_testing( count() );
|
|
|
|
|
2016-12-31 15:40:26 +01:00
|
|
|
sub switch {
|
|
|
|
my $type = shift;
|
2017-01-02 21:20:42 +01:00
|
|
|
pass( '==> Switching to ' . uc($type) . ' <==' );
|
|
|
|
count(1);
|
2017-02-08 23:18:52 +01:00
|
|
|
@Lemonldap::NG::Handler::Main::_onReload = @{
|
2016-12-31 15:40:26 +01:00
|
|
|
$handlerOR{$type};
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
2017-01-02 21:35:37 +01:00
|
|
|
sub op {
|
2019-07-02 20:03:40 +02:00
|
|
|
return LLNG::Manager::Test->new( {
|
2016-12-31 09:39:31 +01:00
|
|
|
ini => {
|
|
|
|
logLevel => $debug,
|
|
|
|
domain => 'idp.com',
|
2017-06-12 21:10:37 +02:00
|
|
|
portal => 'http://auth.op.com/',
|
2016-12-31 09:39:31 +01:00
|
|
|
authentication => 'Demo',
|
2017-02-05 10:13:20 +01:00
|
|
|
userDB => 'Same',
|
2016-12-31 09:39:31 +01:00
|
|
|
issuerDBOpenIDConnectActivation => "1",
|
2018-05-05 21:17:54 +02:00
|
|
|
restSessionServer => 1,
|
2016-12-31 09:39:31 +01:00
|
|
|
oidcRPMetaDataExportedVars => {
|
|
|
|
rp => {
|
|
|
|
email => "mail",
|
|
|
|
family_name => "cn",
|
|
|
|
name => "cn"
|
|
|
|
}
|
|
|
|
},
|
|
|
|
oidcServiceMetaDataAuthorizeURI => "authorize",
|
2017-01-04 23:19:17 +01:00
|
|
|
oidcServiceMetaDataCheckSessionURI => "checksession.html",
|
2016-12-31 09:39:31 +01:00
|
|
|
oidcServiceMetaDataJWKSURI => "jwks",
|
|
|
|
oidcServiceMetaDataEndSessionURI => "logout",
|
|
|
|
oidcServiceMetaDataRegistrationURI => "register",
|
|
|
|
oidcServiceMetaDataTokenURI => "token",
|
|
|
|
oidcServiceMetaDataUserInfoURI => "userinfo",
|
|
|
|
oidcServiceAllowHybridFlow => 1,
|
|
|
|
oidcServiceAllowImplicitFlow => 1,
|
|
|
|
oidcServiceAllowDynamicRegistration => 1,
|
|
|
|
oidcServiceAllowAuthorizationCodeFlow => 1,
|
|
|
|
oidcRPMetaDataOptions => {
|
|
|
|
rp => {
|
2016-12-31 15:40:26 +01:00
|
|
|
oidcRPMetaDataOptionsDisplayName => "RP",
|
|
|
|
oidcRPMetaDataOptionsIDTokenExpiration => 3600,
|
|
|
|
oidcRPMetaDataOptionsClientID => "rpid",
|
|
|
|
oidcRPMetaDataOptionsIDTokenSignAlg => "HS512",
|
|
|
|
oidcRPMetaDataOptionsBypassConsent => 0,
|
|
|
|
oidcRPMetaDataOptionsClientSecret => "rpsecret",
|
|
|
|
oidcRPMetaDataOptionsUserIDAttr => "",
|
2017-05-18 16:52:38 +02:00
|
|
|
oidcRPMetaDataOptionsAccessTokenExpiration => 3600,
|
2017-06-12 21:10:37 +02:00
|
|
|
oidcRPMetaDataOptionsPostLogoutRedirectUris =>
|
|
|
|
"http://auth.rp.com/?logout=1"
|
2016-12-31 09:39:31 +01:00
|
|
|
}
|
|
|
|
},
|
|
|
|
oidcOPMetaDataOptions => {},
|
|
|
|
oidcOPMetaDataJSON => {},
|
|
|
|
oidcOPMetaDataJWKS => {},
|
|
|
|
oidcServiceMetaDataAuthnContext => {
|
|
|
|
'loa-4' => 4,
|
|
|
|
'loa-1' => 1,
|
|
|
|
'loa-5' => 5,
|
|
|
|
'loa-2' => 2,
|
|
|
|
'loa-3' => 3
|
|
|
|
},
|
2016-12-31 15:40:26 +01:00
|
|
|
oidcServicePrivateKeySig => "-----BEGIN RSA PRIVATE KEY-----
|
2016-12-31 14:08:39 +01:00
|
|
|
MIIEowIBAAKCAQEAs2jsmIoFuWzMkilJaA8//5/T30cnuzX9GImXUrFR2k9EKTMt
|
|
|
|
GMHCdKlWOl3BV+BTAU9TLz7Jzd/iJ5GJ6B8TrH1PHFmHpy8/qE/S5OhinIpIi7eb
|
|
|
|
ABqnoVcwDdCa8ugzq8k8SWxhRNXfVIlwz4NH1caJ8lmiERFj7IvNKqEhzAk0pyDr
|
|
|
|
8hubveTC39xREujKlsqutpPAFPJ3f2ybVsdykX5rx0h5SslG3jVWYhZ/SOb2aIzO
|
|
|
|
r0RMjhQmsYRwbpt3anjlBZ98aOzg7GAkbO8093X5VVk9vaPRg0zxJQ0Do0YLyzkR
|
|
|
|
isSAIFb0tdKuDnjRGK6y/N2j6At2HjkxntbtGQIDAQABAoIBADYq6LxJd977LWy3
|
|
|
|
0HT9nboFPIf+SM2qSEc/S5Po+6ipJBA4ZlZCMf7dHa6znet1TDpqA9iQ4YcqIHMH
|
|
|
|
6xZNQ7hhgSAzG9TrXBHqP+djDlrrGWotvjuy0IfS9ixFnnLWjrtAH9afRWLuG+a/
|
|
|
|
NHNC1M6DiiTE0TzL/lpt/zzut3CNmWzH+t19X6UsxUg95AzooEeewEYkv25eumWD
|
|
|
|
mfQZfCtSlIw1sp/QwxeJa/6LJw7KcPZ1wXUm1BN0b9eiKt9Cmni1MS7elgpZlgGt
|
|
|
|
xtfGTZtNLQ7bgDiM8MHzUfPBhbceNSIx2BeCuOCs/7eaqgpyYHBbAbuBQex2H61l
|
|
|
|
Lcc3Tz0CgYEA4Kx/avpCPxnvsJ+nHVQm5d/WERuDxk4vH1DNuCYBvXTdVCGADf6a
|
|
|
|
F5No1JcTH3nPTyPWazOyGdT9LcsEJicLyD8vCM6hBFstG4XjqcAuqG/9DRsElpHQ
|
|
|
|
yi1zc5DNP7Vxmiz9wII0Mjy0abYKtxnXh9YK4a9g6wrcTpvShhIcIb8CgYEAzGzG
|
|
|
|
lorVCfX9jXULIznnR/uuP5aSnTEsn0xJeqTlbW0RFWLdj8aIL1peirh1X89HroB9
|
|
|
|
GeTNqEJXD+3CVL2cx+BRggMDUmEz4hR59meZCDGUyT5fex4LIsceb/ESUl2jo6Sw
|
|
|
|
HXwWbN67rQ55N4oiOcOppsGxzOHkl5HdExKidycCgYEAr5Qev2tz+fw65LzfzHvH
|
|
|
|
Kj4S/KuT/5V6He731cFd+sEpdmX3vPgLVAFPG1Q1DZQT/rTzDDQKK0XX1cGiLG63
|
|
|
|
NnaqOye/jbfzOF8Z277kt51NFMDYhRLPKDD82IOA4xjY/rPKWndmcxwdob8yAIWh
|
|
|
|
efY76sMz6ntCT+xWSZA9i+ECgYBWMZM2TIlxLsBfEbfFfZewOUWKWEGvd9l5vV/K
|
|
|
|
D5cRIYivfMUw5yPq2267jPUolayCvniBH4E7beVpuPVUZ7KgcEvNxtlytbt7muil
|
|
|
|
5Z6X3tf+VodJ0Swe2NhTmNEB26uwxzLe68BE3VFCsbSYn2y48HAq+MawPZr18bHG
|
|
|
|
ZfgMxwKBgHHRg6HYqF5Pegzk1746uH2G+OoCovk5ylGGYzcH2ghWTK4agCHfBcDt
|
|
|
|
EYqYAev/l82wi+OZ5O8U+qjFUpT1CVeUJdDs0o5u19v0UJjunU1cwh9jsxBZAWLy
|
|
|
|
PAGd6SWf4S3uQCTw6dLeMna25YIlPh5qPA6I/pAahe8e3nSu2ckl
|
|
|
|
-----END RSA PRIVATE KEY-----
|
|
|
|
",
|
2016-12-31 15:40:26 +01:00
|
|
|
oidcServicePublicKeySig => "-----BEGIN PUBLIC KEY-----
|
2016-12-31 14:08:39 +01:00
|
|
|
MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAs2jsmIoFuWzMkilJaA8/
|
|
|
|
/5/T30cnuzX9GImXUrFR2k9EKTMtGMHCdKlWOl3BV+BTAU9TLz7Jzd/iJ5GJ6B8T
|
|
|
|
rH1PHFmHpy8/qE/S5OhinIpIi7ebABqnoVcwDdCa8ugzq8k8SWxhRNXfVIlwz4NH
|
|
|
|
1caJ8lmiERFj7IvNKqEhzAk0pyDr8hubveTC39xREujKlsqutpPAFPJ3f2ybVsdy
|
|
|
|
kX5rx0h5SslG3jVWYhZ/SOb2aIzOr0RMjhQmsYRwbpt3anjlBZ98aOzg7GAkbO80
|
|
|
|
93X5VVk9vaPRg0zxJQ0Do0YLyzkRisSAIFb0tdKuDnjRGK6y/N2j6At2Hjkxntbt
|
|
|
|
GQIDAQAB
|
|
|
|
-----END PUBLIC KEY-----
|
|
|
|
",
|
2016-12-31 09:39:31 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
);
|
|
|
|
}
|
2016-12-31 15:40:26 +01:00
|
|
|
|
2017-01-02 21:35:37 +01:00
|
|
|
sub rp {
|
2016-12-31 15:40:26 +01:00
|
|
|
my ( $jwks, $metadata ) = @_;
|
2019-07-02 20:03:40 +02:00
|
|
|
return LLNG::Manager::Test->new( {
|
2016-12-31 15:40:26 +01:00
|
|
|
ini => {
|
|
|
|
logLevel => $debug,
|
|
|
|
domain => 'rp.com',
|
2017-06-12 21:10:37 +02:00
|
|
|
portal => 'http://auth.rp.com/',
|
2016-12-31 15:40:26 +01:00
|
|
|
authentication => 'OpenIDConnect',
|
2017-02-05 10:13:20 +01:00
|
|
|
userDB => 'Same',
|
2017-03-02 21:52:12 +01:00
|
|
|
restSessionServer => 1,
|
2016-12-31 15:40:26 +01:00
|
|
|
oidcOPMetaDataExportedVars => {
|
|
|
|
op => {
|
|
|
|
cn => "name",
|
|
|
|
uid => "sub",
|
|
|
|
sn => "family_name",
|
|
|
|
mail => "email"
|
|
|
|
}
|
|
|
|
},
|
|
|
|
oidcOPMetaDataOptions => {
|
|
|
|
op => {
|
2019-07-02 17:27:17 +02:00
|
|
|
oidcOPMetaDataOptionsCheckJWTSignature => 1,
|
|
|
|
oidcOPMetaDataOptionsJWKSTimeout => 0,
|
|
|
|
oidcOPMetaDataOptionsClientSecret => "rpsecret",
|
2016-12-31 15:40:26 +01:00
|
|
|
oidcOPMetaDataOptionsScope => "openid profile",
|
|
|
|
oidcOPMetaDataOptionsStoreIDToken => 0,
|
2019-02-28 10:37:51 +01:00
|
|
|
oidcOPMetaDataOptionsMaxAge => 30,
|
2016-12-31 15:40:26 +01:00
|
|
|
oidcOPMetaDataOptionsDisplay => "",
|
|
|
|
oidcOPMetaDataOptionsClientID => "rpid",
|
|
|
|
oidcOPMetaDataOptionsConfigurationURI =>
|
|
|
|
"https://auth.op.com/.well-known/openid-configuration"
|
|
|
|
}
|
|
|
|
},
|
|
|
|
oidcOPMetaDataJWKS => {
|
|
|
|
op => $jwks,
|
|
|
|
},
|
|
|
|
oidcOPMetaDataJSON => {
|
|
|
|
op => $metadata,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
);
|
|
|
|
}
|