2018-09-05 22:24:23 +02:00
|
|
|
use lib 'inc';
|
2016-12-16 07:03:30 +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-16 07:03:30 +01:00
|
|
|
use MIME::Base64;
|
|
|
|
|
|
|
|
BEGIN {
|
|
|
|
require 't/test-lib.pm';
|
2020-02-05 20:05:20 +01:00
|
|
|
require 't/saml-lib.pm';
|
2016-12-16 07:03:30 +01:00
|
|
|
}
|
|
|
|
|
2020-02-05 17:12:07 +01:00
|
|
|
my $maintests = 13;
|
2016-12-19 06:31:51 +01:00
|
|
|
my $debug = 'error';
|
2016-12-16 07:03:30 +01:00
|
|
|
my ( $issuer, $sp, $res );
|
|
|
|
|
2018-04-09 22:56:14 +02:00
|
|
|
# Redefine LWP methods for tests
|
|
|
|
LWP::Protocol::PSGI->register(
|
|
|
|
sub {
|
|
|
|
my $req = Plack::Request->new(@_);
|
|
|
|
ok( $req->uri =~ m#http://auth.((?:id|s)p).com(.*)#, 'SOAP request' );
|
|
|
|
my $host = $1;
|
|
|
|
my $url = $2;
|
|
|
|
my $res;
|
2019-07-02 20:03:40 +02:00
|
|
|
my $s = $req->content;
|
2018-04-09 22:56:14 +02:00
|
|
|
my $client = ( $host eq 'idp' ? $issuer : $sp );
|
|
|
|
ok(
|
|
|
|
$res = $client->_post(
|
|
|
|
$url, IO::String->new($s),
|
|
|
|
length => length($s),
|
|
|
|
type => 'application/xml',
|
|
|
|
),
|
|
|
|
'Execute request'
|
|
|
|
);
|
|
|
|
ok( ( $res->[0] == 200 or $res->[0] == 400 ), 'Response is 200 or 400' )
|
|
|
|
or explain( $res->[0], "200 or 400" );
|
2020-07-24 14:03:48 +02:00
|
|
|
ok( getHeader( $res, 'Content-Type' ) =~ m#^text/xml#,
|
2018-04-09 22:56:14 +02:00
|
|
|
'Content is XML' )
|
2020-07-24 14:03:48 +02:00
|
|
|
or explain( $res->[1], 'Content-Type => text/xml' );
|
2018-04-09 22:56:14 +02:00
|
|
|
count(4);
|
|
|
|
return $res;
|
|
|
|
}
|
|
|
|
);
|
|
|
|
|
2016-12-16 07:03:30 +01:00
|
|
|
SKIP: {
|
|
|
|
eval "use Lasso";
|
|
|
|
if ($@) {
|
|
|
|
skip 'Lasso not found', $maintests;
|
|
|
|
}
|
|
|
|
|
|
|
|
# Initialization
|
2020-02-20 23:34:02 +01:00
|
|
|
$issuer = register( 'issuer', \&issuer );
|
|
|
|
$sp = register( 'sp', \&sp );
|
2016-12-16 07:03:30 +01:00
|
|
|
|
|
|
|
# Simple authentication on IdP
|
|
|
|
switch ('issuer');
|
|
|
|
ok(
|
|
|
|
$res = $issuer->_post(
|
2017-03-03 18:25:03 +01:00
|
|
|
'/', IO::String->new('user=russian&password=russian'),
|
2017-03-03 17:57:04 +01:00
|
|
|
length => 29
|
2016-12-16 07:03:30 +01:00
|
|
|
),
|
|
|
|
'Auth query'
|
|
|
|
);
|
2016-12-23 11:02:21 +01:00
|
|
|
expectOK($res);
|
|
|
|
my $idpId = expectCookie($res);
|
2016-12-16 07:03:30 +01:00
|
|
|
|
|
|
|
# Query IdP to access to SP
|
|
|
|
ok(
|
|
|
|
$res = $issuer->_get(
|
|
|
|
'/saml/singleSignOn',
|
|
|
|
query => 'IDPInitiated=1&spConfKey=sp.com',
|
|
|
|
cookie => "lemonldap=$idpId",
|
|
|
|
accept => 'test/html'
|
|
|
|
),
|
|
|
|
'Query IdP to access to SP'
|
|
|
|
);
|
2016-12-26 10:23:35 +01:00
|
|
|
my ( $url, $query ) = expectRedirection( $res,
|
|
|
|
qr#http://auth.sp.com(/saml/proxySingleSignOnArtifact)\?(SAMLart=[^&]+)#
|
|
|
|
);
|
|
|
|
switch ('sp');
|
|
|
|
ok( $res = $sp->_get( $url, query => $query, accept => 'test/html' ),
|
|
|
|
'Give artifact to SP' );
|
|
|
|
expectRedirection( $res, 'http://auth.sp.com' );
|
2016-12-16 07:03:30 +01:00
|
|
|
|
|
|
|
# Verify authentication on SP
|
2016-12-23 11:02:21 +01:00
|
|
|
my $spId = expectCookie($res);
|
|
|
|
expectRedirection( $res, 'http://auth.sp.com' );
|
2016-12-16 07:03:30 +01:00
|
|
|
|
|
|
|
ok( $res = $sp->_get( '/', cookie => "lemonldap=$spId" ), 'Get / on SP' );
|
2016-12-23 11:02:21 +01:00
|
|
|
expectOK($res);
|
2017-03-03 17:57:04 +01:00
|
|
|
expectAuthenticatedAs( $res, 'ru@badwolf.org@idp' );
|
|
|
|
|
|
|
|
# Verify UTF-8
|
|
|
|
ok( $res = $sp->_get("/sessions/global/$spId"), 'Get UTF-8' );
|
|
|
|
expectOK($res);
|
|
|
|
ok( $res = eval { JSON::from_json( $res->[2]->[0] ) }, ' GET JSON' )
|
|
|
|
or print STDERR $@;
|
|
|
|
ok( $res->{cn} eq 'Русский', 'UTF-8 values' )
|
|
|
|
or explain( $res, 'cn => Frédéric Accents' );
|
2016-12-16 07:03:30 +01:00
|
|
|
|
|
|
|
# Logout initiated by IdP
|
|
|
|
switch ('issuer');
|
|
|
|
ok(
|
|
|
|
$res = $issuer->_get(
|
|
|
|
'/',
|
|
|
|
query => 'logout',
|
|
|
|
cookie => "lemonldap=$idpId",
|
|
|
|
accept => 'text/html'
|
|
|
|
),
|
2016-12-23 11:02:21 +01:00
|
|
|
'Query IdP for logout'
|
2016-12-16 07:03:30 +01:00
|
|
|
);
|
2016-12-23 11:02:21 +01:00
|
|
|
expectOK($res);
|
2016-12-16 07:03:30 +01:00
|
|
|
|
2019-11-06 18:38:58 +01:00
|
|
|
my $removedCookie = expectCookie($res);
|
2020-02-20 23:34:02 +01:00
|
|
|
is( $removedCookie, 0, "SSO cookie removed" );
|
2019-11-06 18:38:58 +01:00
|
|
|
|
2016-12-19 06:31:51 +01:00
|
|
|
ok(
|
|
|
|
$res->[2]->[0] =~
|
|
|
|
m#img src="http://auth.idp.com(/saml/relaySingleLogoutSOAP)\?(relay=.*?)"#s,
|
|
|
|
'Get image request'
|
|
|
|
);
|
|
|
|
|
|
|
|
ok(
|
|
|
|
$res = $issuer->_get(
|
|
|
|
$1,
|
2016-12-23 11:02:21 +01:00
|
|
|
query => $2,
|
2016-12-19 06:31:51 +01:00
|
|
|
accept => 'text/html'
|
|
|
|
),
|
|
|
|
'Get image'
|
|
|
|
);
|
2019-05-11 20:18:43 +02:00
|
|
|
expectRedirection( $res, "http://auth.idp.com/static/common/icons/ok.png" );
|
2016-12-19 06:31:51 +01:00
|
|
|
|
2016-12-23 17:03:36 +01:00
|
|
|
# Test if logout is done
|
|
|
|
switch ('issuer');
|
|
|
|
ok(
|
2018-07-18 08:02:48 +02:00
|
|
|
$res = $issuer->_get(
|
2016-12-23 17:03:36 +01:00
|
|
|
'/', cookie => "lemonldap=$idpId",
|
|
|
|
),
|
|
|
|
'Test if user is reject on IdP'
|
|
|
|
);
|
|
|
|
expectReject($res);
|
|
|
|
|
|
|
|
switch ('sp');
|
|
|
|
ok(
|
|
|
|
$res = $sp->_get(
|
|
|
|
'/',
|
|
|
|
accept => 'text/html',
|
2019-10-01 11:18:20 +02:00
|
|
|
cookie => "lemonldap=$spId"
|
2016-12-23 17:03:36 +01:00
|
|
|
),
|
|
|
|
'Test if user is reject on SP'
|
|
|
|
);
|
2018-07-18 08:02:48 +02:00
|
|
|
expectRedirection( $res,
|
|
|
|
qr#^http://auth.idp.com(/saml/singleSignOnArtifact)\?(SAMLart=.+)# );
|
2016-12-16 07:03:30 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
count($maintests);
|
|
|
|
clean_sessions();
|
|
|
|
done_testing( count() );
|
|
|
|
|
|
|
|
sub issuer {
|
2019-02-07 09:27:56 +01:00
|
|
|
return LLNG::Manager::Test->new( {
|
2016-12-16 07:03:30 +01:00
|
|
|
ini => {
|
|
|
|
logLevel => $debug,
|
|
|
|
domain => 'idp.com',
|
|
|
|
portal => 'http://auth.idp.com',
|
|
|
|
authentication => 'Demo',
|
2017-02-05 10:13:20 +01:00
|
|
|
userDB => 'Same',
|
2016-12-16 07:03:30 +01:00
|
|
|
issuerDBSAMLActivation => 1,
|
|
|
|
samlSPMetaDataOptions => {
|
|
|
|
'sp.com' => {
|
|
|
|
samlSPMetaDataOptionsEncryptionMode => 'none',
|
|
|
|
samlSPMetaDataOptionsEnableIDPInitiatedURL => 1,
|
|
|
|
samlSPMetaDataOptionsSignSSOMessage => 1,
|
|
|
|
samlSPMetaDataOptionsSignSLOMessage => 1,
|
|
|
|
samlSPMetaDataOptionsCheckSSOMessageSignature => 1,
|
|
|
|
samlSPMetaDataOptionsCheckSLOMessageSignature => 1,
|
|
|
|
}
|
|
|
|
},
|
|
|
|
samlSPMetaDataExportedAttributes => {
|
|
|
|
'sp.com' => {
|
|
|
|
cn =>
|
|
|
|
'1;cn;urn:oasis:names:tc:SAML:2.0:attrname-format:basic',
|
|
|
|
uid =>
|
|
|
|
'1;uid;urn:oasis:names:tc:SAML:2.0:attrname-format:basic',
|
|
|
|
}
|
|
|
|
},
|
|
|
|
samlOrganizationDisplayName => "IDP",
|
|
|
|
samlOrganizationName => "IDP",
|
|
|
|
samlOrganizationURL => "http://www.idp.com/",
|
2020-02-05 20:05:20 +01:00
|
|
|
samlServicePrivateKeyEnc => saml_key_idp_private_enc,
|
2020-02-20 23:34:02 +01:00
|
|
|
samlServicePrivateKeySig => saml_key_idp_private_sig,
|
|
|
|
samlServicePublicKeyEnc => saml_key_idp_public_enc,
|
|
|
|
samlServicePublicKeySig => saml_key_idp_public_sig,
|
|
|
|
samlSPMetaDataXML => {
|
2016-12-16 07:03:30 +01:00
|
|
|
"sp.com" => {
|
|
|
|
samlSPMetaDataXML => <<EOF
|
|
|
|
<?xml version="1.0"?>
|
|
|
|
<EntityDescriptor xmlns="urn:oasis:names:tc:SAML:2.0:metadata"
|
|
|
|
xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion"
|
|
|
|
xmlns:ds="http://www.w3.org/2000/09/xmldsig#"
|
|
|
|
entityID="http://auth.sp.com/saml/metadata">
|
|
|
|
<IDPSSODescriptor WantAuthnRequestsSigned="true"
|
|
|
|
protocolSupportEnumeration="urn:oasis:names:tc:SAML:2.0:protocol">
|
|
|
|
|
|
|
|
<KeyDescriptor use="signing">
|
|
|
|
<ds:KeyInfo xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
|
|
|
|
<ds:KeyValue>
|
|
|
|
<RSAKeyValue xmlns="http://www.w3.org/2000/09/xmldsig#">
|
|
|
|
<Modulus>
|
|
|
|
u4iToYAEmWQxgZDihGVzMMql1elPn37domWcvXeU2E4yt2hh5jkQHiFjgodfOlNeRIw5QJVlUBwr
|
|
|
|
+CQvbaKRFXd7BrOhQIDC0TZPRVB0XHarUtsCuDekN4/2GKSzHsoToKUVPWq9thsuek3xkpsJGZNX
|
|
|
|
7bglfEc9+QQpYTqN1rkdN1PVU0epNMokFFGho5pLRqLUV5+I/QXAL49jfTjaSxsp4UndTI8/+mGS
|
|
|
|
RSq+nrT2zyQRM/vkj5vR9ZVz67HO/+Wk3Mx6RAwkVcMdgMAqCq8odmbI0yCRZiTL9ybKWRKqWJoK
|
|
|
|
J0p5+Q2fPEBPupQZR09Jt/JPuLVSsGfCxi9Nqw==</Modulus>
|
|
|
|
<Exponent>AQAB</Exponent>
|
|
|
|
</RSAKeyValue>
|
|
|
|
</ds:KeyValue>
|
|
|
|
</ds:KeyInfo>
|
|
|
|
</KeyDescriptor>
|
|
|
|
<KeyDescriptor use="encryption">
|
|
|
|
<ds:KeyInfo xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
|
|
|
|
<ds:KeyValue>
|
|
|
|
<RSAKeyValue xmlns="http://www.w3.org/2000/09/xmldsig#">
|
|
|
|
<Modulus>
|
|
|
|
sRaod2RZ8hMFBl+VhsnhyPM8l/Fj1obnBxfQIaWuHFIFfXiGe/CYHuZ5QJQLnZxHMJX6LL3Sh+Us
|
|
|
|
og3p0jpijpcg0QgfBSEkfopKTgReYN8DiDIll0rV1XdTni7E85Nd1YyNy3ui/ZD+UShWwqu6jLVL
|
|
|
|
R+QUm+/1LIKYb3OCBTvOlY7xHoP6NSU1+Mr+YzGBUacdO2vnNxe/PQhxIeP1zO0njuqGHkwEpy8r
|
|
|
|
UWRZbbDn31TmKjqlhgtsz5HPhbRaYEExhyepKgBiNz+RyxtYXVhuG8OrWQDoS5gYHSjdw1CTJyix
|
|
|
|
eJwyoqA9RGYguG5nh9zndi3LWAh7Z0lx+tIz+w==</Modulus>
|
|
|
|
<Exponent>AQAB</Exponent>
|
|
|
|
</RSAKeyValue>
|
|
|
|
</ds:KeyValue>
|
|
|
|
</ds:KeyInfo>
|
|
|
|
</KeyDescriptor>
|
|
|
|
<ArtifactResolutionService isDefault="true" index="0"
|
|
|
|
Binding="urn:oasis:names:tc:SAML:2.0:bindings:SOAP"
|
|
|
|
Location="http://auth.sp.com/saml/artifact" />
|
|
|
|
<SingleLogoutService Binding="urn:oasis:names:tc:SAML:2.0:bindings:SOAP"
|
|
|
|
Location="http://auth.sp.com/saml/singleLogoutSOAP" />
|
|
|
|
<NameIDFormat>
|
|
|
|
urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress</NameIDFormat>
|
|
|
|
<NameIDFormat>
|
|
|
|
urn:oasis:names:tc:SAML:1.1:nameid-format:X509SubjectName</NameIDFormat>
|
|
|
|
<NameIDFormat>
|
|
|
|
urn:oasis:names:tc:SAML:1.1:nameid-format:WindowsDomainQualifiedName</NameIDFormat>
|
|
|
|
<NameIDFormat>
|
|
|
|
urn:oasis:names:tc:SAML:2.0:nameid-format:kerberos</NameIDFormat>
|
|
|
|
<NameIDFormat>
|
|
|
|
urn:oasis:names:tc:SAML:2.0:nameid-format:entity</NameIDFormat>
|
|
|
|
<NameIDFormat>
|
|
|
|
urn:oasis:names:tc:SAML:2.0:nameid-format:transient</NameIDFormat>
|
|
|
|
<SingleSignOnService Binding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Artifact"
|
|
|
|
Location="http://auth.sp.com/saml/singleSignOnArtifact" />
|
|
|
|
</IDPSSODescriptor>
|
|
|
|
<SPSSODescriptor AuthnRequestsSigned="true"
|
|
|
|
WantAssertionsSigned="true"
|
|
|
|
protocolSupportEnumeration="urn:oasis:names:tc:SAML:2.0:protocol">
|
|
|
|
|
|
|
|
<KeyDescriptor use="signing">
|
|
|
|
<ds:KeyInfo xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
|
|
|
|
<ds:KeyValue>
|
|
|
|
<RSAKeyValue xmlns="http://www.w3.org/2000/09/xmldsig#">
|
|
|
|
<Modulus>
|
|
|
|
u4iToYAEmWQxgZDihGVzMMql1elPn37domWcvXeU2E4yt2hh5jkQHiFjgodfOlNeRIw5QJVlUBwr
|
|
|
|
+CQvbaKRFXd7BrOhQIDC0TZPRVB0XHarUtsCuDekN4/2GKSzHsoToKUVPWq9thsuek3xkpsJGZNX
|
|
|
|
7bglfEc9+QQpYTqN1rkdN1PVU0epNMokFFGho5pLRqLUV5+I/QXAL49jfTjaSxsp4UndTI8/+mGS
|
|
|
|
RSq+nrT2zyQRM/vkj5vR9ZVz67HO/+Wk3Mx6RAwkVcMdgMAqCq8odmbI0yCRZiTL9ybKWRKqWJoK
|
|
|
|
J0p5+Q2fPEBPupQZR09Jt/JPuLVSsGfCxi9Nqw==</Modulus>
|
|
|
|
<Exponent>AQAB</Exponent>
|
|
|
|
</RSAKeyValue>
|
|
|
|
</ds:KeyValue>
|
|
|
|
</ds:KeyInfo>
|
|
|
|
</KeyDescriptor>
|
|
|
|
<KeyDescriptor use="encryption">
|
|
|
|
<ds:KeyInfo xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
|
|
|
|
<ds:KeyValue>
|
|
|
|
<RSAKeyValue xmlns="http://www.w3.org/2000/09/xmldsig#">
|
|
|
|
<Modulus>
|
|
|
|
sRaod2RZ8hMFBl+VhsnhyPM8l/Fj1obnBxfQIaWuHFIFfXiGe/CYHuZ5QJQLnZxHMJX6LL3Sh+Us
|
|
|
|
og3p0jpijpcg0QgfBSEkfopKTgReYN8DiDIll0rV1XdTni7E85Nd1YyNy3ui/ZD+UShWwqu6jLVL
|
|
|
|
R+QUm+/1LIKYb3OCBTvOlY7xHoP6NSU1+Mr+YzGBUacdO2vnNxe/PQhxIeP1zO0njuqGHkwEpy8r
|
|
|
|
UWRZbbDn31TmKjqlhgtsz5HPhbRaYEExhyepKgBiNz+RyxtYXVhuG8OrWQDoS5gYHSjdw1CTJyix
|
|
|
|
eJwyoqA9RGYguG5nh9zndi3LWAh7Z0lx+tIz+w==</Modulus>
|
|
|
|
<Exponent>AQAB</Exponent>
|
|
|
|
</RSAKeyValue>
|
|
|
|
</ds:KeyValue>
|
|
|
|
</ds:KeyInfo>
|
|
|
|
</KeyDescriptor>
|
|
|
|
<ArtifactResolutionService isDefault="true" index="0"
|
|
|
|
Binding="urn:oasis:names:tc:SAML:2.0:bindings:SOAP"
|
|
|
|
Location="http://auth.sp.com/saml/artifact" />
|
|
|
|
<SingleLogoutService Binding="urn:oasis:names:tc:SAML:2.0:bindings:SOAP"
|
|
|
|
Location="http://auth.sp.com/saml/proxySingleLogoutSOAP" />
|
|
|
|
<NameIDFormat>
|
|
|
|
urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress</NameIDFormat>
|
|
|
|
<NameIDFormat>
|
|
|
|
urn:oasis:names:tc:SAML:1.1:nameid-format:X509SubjectName</NameIDFormat>
|
|
|
|
<NameIDFormat>
|
|
|
|
urn:oasis:names:tc:SAML:1.1:nameid-format:WindowsDomainQualifiedName</NameIDFormat>
|
|
|
|
<NameIDFormat>
|
|
|
|
urn:oasis:names:tc:SAML:2.0:nameid-format:kerberos</NameIDFormat>
|
|
|
|
<NameIDFormat>
|
|
|
|
urn:oasis:names:tc:SAML:2.0:nameid-format:entity</NameIDFormat>
|
|
|
|
<NameIDFormat>
|
|
|
|
urn:oasis:names:tc:SAML:2.0:nameid-format:transient</NameIDFormat>
|
|
|
|
<AssertionConsumerService isDefault="true" index="0"
|
|
|
|
Binding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Artifact"
|
|
|
|
Location="http://auth.sp.com/saml/proxySingleSignOnArtifact" />
|
|
|
|
</SPSSODescriptor>
|
|
|
|
<AttributeAuthorityDescriptor protocolSupportEnumeration="urn:oasis:names:tc:SAML:2.0:protocol">
|
|
|
|
|
|
|
|
<KeyDescriptor use="signing">
|
|
|
|
<ds:KeyInfo xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
|
|
|
|
<ds:KeyValue>
|
|
|
|
<RSAKeyValue xmlns="http://www.w3.org/2000/09/xmldsig#">
|
|
|
|
<Modulus>
|
|
|
|
u4iToYAEmWQxgZDihGVzMMql1elPn37domWcvXeU2E4yt2hh5jkQHiFjgodfOlNeRIw5QJVlUBwr
|
|
|
|
+CQvbaKRFXd7BrOhQIDC0TZPRVB0XHarUtsCuDekN4/2GKSzHsoToKUVPWq9thsuek3xkpsJGZNX
|
|
|
|
7bglfEc9+QQpYTqN1rkdN1PVU0epNMokFFGho5pLRqLUV5+I/QXAL49jfTjaSxsp4UndTI8/+mGS
|
|
|
|
RSq+nrT2zyQRM/vkj5vR9ZVz67HO/+Wk3Mx6RAwkVcMdgMAqCq8odmbI0yCRZiTL9ybKWRKqWJoK
|
|
|
|
J0p5+Q2fPEBPupQZR09Jt/JPuLVSsGfCxi9Nqw==</Modulus>
|
|
|
|
<Exponent>AQAB</Exponent>
|
|
|
|
</RSAKeyValue>
|
|
|
|
</ds:KeyValue>
|
|
|
|
</ds:KeyInfo>
|
|
|
|
</KeyDescriptor>
|
|
|
|
<KeyDescriptor use="encryption">
|
|
|
|
<ds:KeyInfo xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
|
|
|
|
<ds:KeyValue>
|
|
|
|
<RSAKeyValue xmlns="http://www.w3.org/2000/09/xmldsig#">
|
|
|
|
<Modulus>
|
|
|
|
sRaod2RZ8hMFBl+VhsnhyPM8l/Fj1obnBxfQIaWuHFIFfXiGe/CYHuZ5QJQLnZxHMJX6LL3Sh+Us
|
|
|
|
og3p0jpijpcg0QgfBSEkfopKTgReYN8DiDIll0rV1XdTni7E85Nd1YyNy3ui/ZD+UShWwqu6jLVL
|
|
|
|
R+QUm+/1LIKYb3OCBTvOlY7xHoP6NSU1+Mr+YzGBUacdO2vnNxe/PQhxIeP1zO0njuqGHkwEpy8r
|
|
|
|
UWRZbbDn31TmKjqlhgtsz5HPhbRaYEExhyepKgBiNz+RyxtYXVhuG8OrWQDoS5gYHSjdw1CTJyix
|
|
|
|
eJwyoqA9RGYguG5nh9zndi3LWAh7Z0lx+tIz+w==</Modulus>
|
|
|
|
<Exponent>AQAB</Exponent>
|
|
|
|
</RSAKeyValue>
|
|
|
|
</ds:KeyValue>
|
|
|
|
</ds:KeyInfo>
|
|
|
|
</KeyDescriptor>
|
|
|
|
<AttributeService Binding="urn:oasis:names:tc:SAML:2.0:bindings:SOAP"
|
|
|
|
Location="http://auth.sp.com/saml/AA/SOAP" />
|
|
|
|
<NameIDFormat>
|
|
|
|
urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress</NameIDFormat>
|
|
|
|
<NameIDFormat>
|
|
|
|
urn:oasis:names:tc:SAML:1.1:nameid-format:X509SubjectName</NameIDFormat>
|
|
|
|
<NameIDFormat>
|
|
|
|
urn:oasis:names:tc:SAML:1.1:nameid-format:WindowsDomainQualifiedName</NameIDFormat>
|
|
|
|
<NameIDFormat>
|
|
|
|
urn:oasis:names:tc:SAML:2.0:nameid-format:kerberos</NameIDFormat>
|
|
|
|
<NameIDFormat>
|
|
|
|
urn:oasis:names:tc:SAML:2.0:nameid-format:entity</NameIDFormat>
|
|
|
|
<NameIDFormat>
|
|
|
|
urn:oasis:names:tc:SAML:2.0:nameid-format:transient</NameIDFormat>
|
|
|
|
</AttributeAuthorityDescriptor>
|
|
|
|
<Organization>
|
|
|
|
<OrganizationName xml:lang="en">SP</OrganizationName>
|
|
|
|
<OrganizationDisplayName xml:lang="en">
|
|
|
|
SP</OrganizationDisplayName>
|
|
|
|
<OrganizationURL xml:lang="en">
|
|
|
|
http://www.sp.com</OrganizationURL>
|
|
|
|
</Organization>
|
|
|
|
</EntityDescriptor>
|
|
|
|
EOF
|
|
|
|
},
|
|
|
|
},
|
|
|
|
}
|
|
|
|
}
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
sub sp {
|
2019-02-07 09:27:56 +01:00
|
|
|
return LLNG::Manager::Test->new( {
|
2016-12-16 07:03:30 +01:00
|
|
|
ini => {
|
|
|
|
logLevel => $debug,
|
|
|
|
domain => 'sp.com',
|
|
|
|
portal => 'http://auth.sp.com',
|
|
|
|
authentication => 'SAML',
|
2017-02-05 10:13:20 +01:00
|
|
|
userDB => 'Same',
|
2016-12-16 07:03:30 +01:00
|
|
|
issuerDBSAMLActivation => 0,
|
2017-03-03 17:57:04 +01:00
|
|
|
restSessionServer => 1,
|
2016-12-16 07:03:30 +01:00
|
|
|
samlIDPMetaDataExportedAttributes => {
|
|
|
|
idp => {
|
|
|
|
mail => "0;mail;;",
|
|
|
|
uid => "1;uid",
|
|
|
|
cn => "0;cn"
|
|
|
|
}
|
|
|
|
},
|
|
|
|
samlIDPMetaDataOptions => {
|
|
|
|
idp => {
|
|
|
|
samlIDPMetaDataOptionsEncryptionMode => 'none',
|
2016-12-27 12:17:25 +01:00
|
|
|
samlIDPMetaDataOptionsSSOBinding => 'artifact-get',
|
|
|
|
samlIDPMetaDataOptionsSLOBinding => 'http-soap',
|
2016-12-16 07:03:30 +01:00
|
|
|
samlIDPMetaDataOptionsSignSSOMessage => 1,
|
|
|
|
samlIDPMetaDataOptionsSignSLOMessage => 1,
|
|
|
|
samlIDPMetaDataOptionsCheckSSOMessageSignature => 1,
|
|
|
|
samlIDPMetaDataOptionsCheckSLOMessageSignature => 1,
|
2017-03-03 18:25:03 +01:00
|
|
|
samlIDPMetaDataOptionsForceUTF8 => 1,
|
2016-12-16 07:03:30 +01:00
|
|
|
samlIDPMetaDataOptionsAllowLoginFromIDP => 1,
|
|
|
|
}
|
|
|
|
},
|
2017-03-03 17:57:04 +01:00
|
|
|
samlIDPMetaDataExportedAttributes => {
|
|
|
|
idp => {
|
|
|
|
"uid" => "0;uid;;",
|
|
|
|
"cn" => "1;cn;;",
|
|
|
|
},
|
|
|
|
},
|
2016-12-16 07:03:30 +01:00
|
|
|
samlIDPMetaDataXML => {
|
|
|
|
idp => {
|
|
|
|
samlIDPMetaDataXML => <<EOF
|
|
|
|
<?xml version="1.0"?>
|
|
|
|
<EntityDescriptor xmlns="urn:oasis:names:tc:SAML:2.0:metadata"
|
|
|
|
xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion"
|
|
|
|
xmlns:ds="http://www.w3.org/2000/09/xmldsig#"
|
|
|
|
entityID="http://auth.idp.com/saml/metadata">
|
|
|
|
<IDPSSODescriptor WantAuthnRequestsSigned="true"
|
|
|
|
protocolSupportEnumeration="urn:oasis:names:tc:SAML:2.0:protocol">
|
|
|
|
|
|
|
|
<KeyDescriptor use="signing">
|
|
|
|
<ds:KeyInfo xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
|
|
|
|
<ds:KeyValue>
|
|
|
|
<RSAKeyValue xmlns="http://www.w3.org/2000/09/xmldsig#">
|
|
|
|
<Modulus>
|
|
|
|
tR/wgDqWB4Maho5V6TjcL/NbNfjgIh7GcgkrB5RZcVT1GTejJlMjUQdgBKBuZXQN+7/29P6UcGq1
|
|
|
|
kYalURq6S8SpeJ1ofp5rBEoD/TIkvU0JOcid65wp+fdzXGXsfiZvHraU74jSCgjP/wqfVGRyBIQz
|
|
|
|
B0SIxSpnrsigqNsE1E94toDMx4wovjHu/9ABAImREV7Sz83OeFF00/sghrjTEJOD/gHf04JCn9Mg
|
|
|
|
NOqvSTysr9LXWg/oUKQDEYeTq9ux6pq/oqv1MxwONbSZPtN5yD41mi+hT8Rh+W8Je8rsiML4VMxz
|
|
|
|
sb1l9303asw6suo5bLTISKNSbu1nt1NkpNxzyw==</Modulus>
|
|
|
|
<Exponent>AQAB</Exponent>
|
|
|
|
</RSAKeyValue>
|
|
|
|
</ds:KeyValue>
|
|
|
|
</ds:KeyInfo>
|
|
|
|
</KeyDescriptor>
|
|
|
|
<KeyDescriptor use="encryption">
|
|
|
|
<ds:KeyInfo xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
|
|
|
|
<ds:KeyValue>
|
|
|
|
<RSAKeyValue xmlns="http://www.w3.org/2000/09/xmldsig#">
|
|
|
|
<Modulus>
|
|
|
|
nfKBDG/K0TnGT7Xu8q1N45sNWvIK91SqNg8nvN2uVeKoHADTcsus5Xn3id5+8Q9TuMFsW9kIEeXi
|
|
|
|
aPKXQa9ryfSNDhWDWloNkpGEeWif2BnHUu46Abu1UBWb0mH6VwcG1PR4qHruLis1odjQ1qnVDNfS
|
|
|
|
EASVIppEBYjDX203ypmURIzU6h53GRRRlf1BLWkbVn9ysmDeR57Xw5Rsx/+tBlcnMrkv/40DSUke
|
|
|
|
hQIl2JmlFrl2Caik+gU4pd20apA/pNLjBZF0OmGoS08AIR5NMd0KFa6CwZUUSHJqH5GFy5Y2yl4l
|
|
|
|
g8K0klAS9q7L7aXI+eFQZhkwidjpxXnHPyxIGQ==</Modulus>
|
|
|
|
<Exponent>AQAB</Exponent>
|
|
|
|
</RSAKeyValue>
|
|
|
|
</ds:KeyValue>
|
|
|
|
</ds:KeyInfo>
|
|
|
|
</KeyDescriptor>
|
|
|
|
<ArtifactResolutionService isDefault="true" index="0"
|
|
|
|
Binding="urn:oasis:names:tc:SAML:2.0:bindings:SOAP"
|
|
|
|
Location="http://auth.idp.com/saml/artifact" />
|
|
|
|
<SingleLogoutService Binding="urn:oasis:names:tc:SAML:2.0:bindings:SOAP"
|
|
|
|
Location="http://auth.idp.com/saml/singleLogoutSOAP" />
|
|
|
|
<NameIDFormat>
|
|
|
|
urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress</NameIDFormat>
|
|
|
|
<NameIDFormat>
|
|
|
|
urn:oasis:names:tc:SAML:1.1:nameid-format:X509SubjectName</NameIDFormat>
|
|
|
|
<NameIDFormat>
|
|
|
|
urn:oasis:names:tc:SAML:1.1:nameid-format:WindowsDomainQualifiedName</NameIDFormat>
|
|
|
|
<NameIDFormat>
|
|
|
|
urn:oasis:names:tc:SAML:2.0:nameid-format:kerberos</NameIDFormat>
|
|
|
|
<NameIDFormat>
|
|
|
|
urn:oasis:names:tc:SAML:2.0:nameid-format:entity</NameIDFormat>
|
|
|
|
<NameIDFormat>
|
|
|
|
urn:oasis:names:tc:SAML:2.0:nameid-format:transient</NameIDFormat>
|
|
|
|
<SingleSignOnService Binding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Artifact"
|
|
|
|
Location="http://auth.idp.com/saml/singleSignOnArtifact" />
|
|
|
|
</IDPSSODescriptor>
|
|
|
|
<SPSSODescriptor AuthnRequestsSigned="true"
|
|
|
|
WantAssertionsSigned="true"
|
|
|
|
protocolSupportEnumeration="urn:oasis:names:tc:SAML:2.0:protocol">
|
|
|
|
|
|
|
|
<KeyDescriptor use="signing">
|
|
|
|
<ds:KeyInfo xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
|
|
|
|
<ds:KeyValue>
|
|
|
|
<RSAKeyValue xmlns="http://www.w3.org/2000/09/xmldsig#">
|
|
|
|
<Modulus>
|
|
|
|
tR/wgDqWB4Maho5V6TjcL/NbNfjgIh7GcgkrB5RZcVT1GTejJlMjUQdgBKBuZXQN+7/29P6UcGq1
|
|
|
|
kYalURq6S8SpeJ1ofp5rBEoD/TIkvU0JOcid65wp+fdzXGXsfiZvHraU74jSCgjP/wqfVGRyBIQz
|
|
|
|
B0SIxSpnrsigqNsE1E94toDMx4wovjHu/9ABAImREV7Sz83OeFF00/sghrjTEJOD/gHf04JCn9Mg
|
|
|
|
NOqvSTysr9LXWg/oUKQDEYeTq9ux6pq/oqv1MxwONbSZPtN5yD41mi+hT8Rh+W8Je8rsiML4VMxz
|
|
|
|
sb1l9303asw6suo5bLTISKNSbu1nt1NkpNxzyw==</Modulus>
|
|
|
|
<Exponent>AQAB</Exponent>
|
|
|
|
</RSAKeyValue>
|
|
|
|
</ds:KeyValue>
|
|
|
|
</ds:KeyInfo>
|
|
|
|
</KeyDescriptor>
|
|
|
|
<KeyDescriptor use="encryption">
|
|
|
|
<ds:KeyInfo xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
|
|
|
|
<ds:KeyValue>
|
|
|
|
<RSAKeyValue xmlns="http://www.w3.org/2000/09/xmldsig#">
|
|
|
|
<Modulus>
|
|
|
|
nfKBDG/K0TnGT7Xu8q1N45sNWvIK91SqNg8nvN2uVeKoHADTcsus5Xn3id5+8Q9TuMFsW9kIEeXi
|
|
|
|
aPKXQa9ryfSNDhWDWloNkpGEeWif2BnHUu46Abu1UBWb0mH6VwcG1PR4qHruLis1odjQ1qnVDNfS
|
|
|
|
EASVIppEBYjDX203ypmURIzU6h53GRRRlf1BLWkbVn9ysmDeR57Xw5Rsx/+tBlcnMrkv/40DSUke
|
|
|
|
hQIl2JmlFrl2Caik+gU4pd20apA/pNLjBZF0OmGoS08AIR5NMd0KFa6CwZUUSHJqH5GFy5Y2yl4l
|
|
|
|
g8K0klAS9q7L7aXI+eFQZhkwidjpxXnHPyxIGQ==</Modulus>
|
|
|
|
<Exponent>AQAB</Exponent>
|
|
|
|
</RSAKeyValue>
|
|
|
|
</ds:KeyValue>
|
|
|
|
</ds:KeyInfo>
|
|
|
|
</KeyDescriptor>
|
|
|
|
<ArtifactResolutionService isDefault="true" index="0"
|
|
|
|
Binding="urn:oasis:names:tc:SAML:2.0:bindings:SOAP"
|
|
|
|
Location="http://auth.idp.com/saml/artifact" />
|
|
|
|
<SingleLogoutService Binding="urn:oasis:names:tc:SAML:2.0:bindings:SOAP"
|
|
|
|
Location="http://auth.idp.com/saml/proxySingleLogoutSOAP" />
|
|
|
|
<NameIDFormat>
|
|
|
|
urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress</NameIDFormat>
|
|
|
|
<NameIDFormat>
|
|
|
|
urn:oasis:names:tc:SAML:1.1:nameid-format:X509SubjectName</NameIDFormat>
|
|
|
|
<NameIDFormat>
|
|
|
|
urn:oasis:names:tc:SAML:1.1:nameid-format:WindowsDomainQualifiedName</NameIDFormat>
|
|
|
|
<NameIDFormat>
|
|
|
|
urn:oasis:names:tc:SAML:2.0:nameid-format:kerberos</NameIDFormat>
|
|
|
|
<NameIDFormat>
|
|
|
|
urn:oasis:names:tc:SAML:2.0:nameid-format:entity</NameIDFormat>
|
|
|
|
<NameIDFormat>
|
|
|
|
urn:oasis:names:tc:SAML:2.0:nameid-format:transient</NameIDFormat>
|
|
|
|
<AssertionConsumerService isDefault="true" index="0"
|
|
|
|
Binding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Artifact"
|
|
|
|
Location="http://auth.idp.com/saml/proxySingleSignOnArtifact" />
|
|
|
|
</SPSSODescriptor>
|
|
|
|
<AttributeAuthorityDescriptor protocolSupportEnumeration="urn:oasis:names:tc:SAML:2.0:protocol">
|
|
|
|
|
|
|
|
<KeyDescriptor use="signing">
|
|
|
|
<ds:KeyInfo xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
|
|
|
|
<ds:KeyValue>
|
|
|
|
<RSAKeyValue xmlns="http://www.w3.org/2000/09/xmldsig#">
|
|
|
|
<Modulus>
|
|
|
|
tR/wgDqWB4Maho5V6TjcL/NbNfjgIh7GcgkrB5RZcVT1GTejJlMjUQdgBKBuZXQN+7/29P6UcGq1
|
|
|
|
kYalURq6S8SpeJ1ofp5rBEoD/TIkvU0JOcid65wp+fdzXGXsfiZvHraU74jSCgjP/wqfVGRyBIQz
|
|
|
|
B0SIxSpnrsigqNsE1E94toDMx4wovjHu/9ABAImREV7Sz83OeFF00/sghrjTEJOD/gHf04JCn9Mg
|
|
|
|
NOqvSTysr9LXWg/oUKQDEYeTq9ux6pq/oqv1MxwONbSZPtN5yD41mi+hT8Rh+W8Je8rsiML4VMxz
|
|
|
|
sb1l9303asw6suo5bLTISKNSbu1nt1NkpNxzyw==</Modulus>
|
|
|
|
<Exponent>AQAB</Exponent>
|
|
|
|
</RSAKeyValue>
|
|
|
|
</ds:KeyValue>
|
|
|
|
</ds:KeyInfo>
|
|
|
|
</KeyDescriptor>
|
|
|
|
<KeyDescriptor use="encryption">
|
|
|
|
<ds:KeyInfo xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
|
|
|
|
<ds:KeyValue>
|
|
|
|
<RSAKeyValue xmlns="http://www.w3.org/2000/09/xmldsig#">
|
|
|
|
<Modulus>
|
|
|
|
nfKBDG/K0TnGT7Xu8q1N45sNWvIK91SqNg8nvN2uVeKoHADTcsus5Xn3id5+8Q9TuMFsW9kIEeXi
|
|
|
|
aPKXQa9ryfSNDhWDWloNkpGEeWif2BnHUu46Abu1UBWb0mH6VwcG1PR4qHruLis1odjQ1qnVDNfS
|
|
|
|
EASVIppEBYjDX203ypmURIzU6h53GRRRlf1BLWkbVn9ysmDeR57Xw5Rsx/+tBlcnMrkv/40DSUke
|
|
|
|
hQIl2JmlFrl2Caik+gU4pd20apA/pNLjBZF0OmGoS08AIR5NMd0KFa6CwZUUSHJqH5GFy5Y2yl4l
|
|
|
|
g8K0klAS9q7L7aXI+eFQZhkwidjpxXnHPyxIGQ==</Modulus>
|
|
|
|
<Exponent>AQAB</Exponent>
|
|
|
|
</RSAKeyValue>
|
|
|
|
</ds:KeyValue>
|
|
|
|
</ds:KeyInfo>
|
|
|
|
</KeyDescriptor>
|
|
|
|
<AttributeService Binding="urn:oasis:names:tc:SAML:2.0:bindings:SOAP"
|
|
|
|
Location="http://auth.idp.com/saml/AA/SOAP" />
|
|
|
|
<NameIDFormat>
|
|
|
|
urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress</NameIDFormat>
|
|
|
|
<NameIDFormat>
|
|
|
|
urn:oasis:names:tc:SAML:1.1:nameid-format:X509SubjectName</NameIDFormat>
|
|
|
|
<NameIDFormat>
|
|
|
|
urn:oasis:names:tc:SAML:1.1:nameid-format:WindowsDomainQualifiedName</NameIDFormat>
|
|
|
|
<NameIDFormat>
|
|
|
|
urn:oasis:names:tc:SAML:2.0:nameid-format:kerberos</NameIDFormat>
|
|
|
|
<NameIDFormat>
|
|
|
|
urn:oasis:names:tc:SAML:2.0:nameid-format:entity</NameIDFormat>
|
|
|
|
<NameIDFormat>
|
|
|
|
urn:oasis:names:tc:SAML:2.0:nameid-format:transient</NameIDFormat>
|
|
|
|
</AttributeAuthorityDescriptor>
|
|
|
|
<Organization>
|
|
|
|
<OrganizationName xml:lang="en">IDP</OrganizationName>
|
|
|
|
<OrganizationDisplayName xml:lang="en">
|
|
|
|
IDP</OrganizationDisplayName>
|
|
|
|
<OrganizationURL xml:lang="en">
|
|
|
|
http://www.idp.fr/</OrganizationURL>
|
|
|
|
</Organization>
|
|
|
|
</EntityDescriptor>
|
|
|
|
EOF
|
|
|
|
}
|
|
|
|
},
|
|
|
|
samlOrganizationDisplayName => "SP",
|
|
|
|
samlOrganizationName => "SP",
|
|
|
|
samlOrganizationURL => "http://www.sp.com",
|
2020-02-05 20:05:20 +01:00
|
|
|
samlServicePublicKeySig => saml_key_sp_public_sig,
|
2020-02-20 23:34:02 +01:00
|
|
|
samlServicePrivateKeyEnc => saml_key_sp_private_enc,
|
|
|
|
samlServicePrivateKeySig => saml_key_sp_private_sig,
|
|
|
|
samlServicePublicKeyEnc => saml_key_sp_public_enc,
|
2016-12-16 07:03:30 +01:00
|
|
|
samlSPSSODescriptorAuthnRequestsSigned => 1,
|
|
|
|
},
|
|
|
|
}
|
|
|
|
);
|
|
|
|
}
|