2018-09-05 22:24:23 +02:00
|
|
|
use lib 'inc';
|
2016-12-07 23:30:00 +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-07 23:30:00 +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-07 23:30:00 +01:00
|
|
|
}
|
|
|
|
|
2020-02-05 17:12:07 +01:00
|
|
|
my $maintests = 12;
|
2016-12-15 21:34:56 +01:00
|
|
|
my $debug = 'error';
|
2016-12-07 23:30:00 +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'
|
|
|
|
);
|
|
|
|
expectOK($res);
|
|
|
|
ok( getHeader( $res, 'Content-Type' ) =~ m#^application/xml#,
|
|
|
|
'Content is XML' )
|
|
|
|
or explain( $res->[1], 'Content-Type => application/xml' );
|
|
|
|
count(3);
|
|
|
|
return $res;
|
|
|
|
}
|
|
|
|
);
|
|
|
|
|
2016-12-07 23:30:00 +01:00
|
|
|
SKIP: {
|
|
|
|
eval "use Lasso";
|
|
|
|
if ($@) {
|
|
|
|
skip 'Lasso not found', $maintests;
|
|
|
|
}
|
|
|
|
|
|
|
|
# Initialization
|
2020-02-05 17:12:07 +01:00
|
|
|
$issuer = register('issuer', \&issuer);
|
2016-12-07 23:30:00 +01:00
|
|
|
|
2020-02-05 17:12:07 +01:00
|
|
|
$sp = register('sp', \&sp);
|
2016-12-07 23:30:00 +01:00
|
|
|
|
|
|
|
# Simple SP access
|
|
|
|
my $res;
|
|
|
|
ok(
|
|
|
|
$res = $sp->_get(
|
|
|
|
'/', accept => 'text/html',
|
|
|
|
),
|
|
|
|
'Unauth SP request'
|
|
|
|
);
|
2016-12-23 11:02:21 +01:00
|
|
|
my ( $url, $query ) = expectRedirection( $res,
|
2016-12-24 09:47:39 +01:00
|
|
|
qr#^http://auth.idp.com(/saml/singleSignOnArtifact)\?(SAMLart=.+)# );
|
2016-12-07 23:30:00 +01:00
|
|
|
|
|
|
|
#ok( decode_base64($samlReq) =~ /^</s, 'SAML request seems valid' )
|
|
|
|
# or explain( decode_base64($samlReq), '<?xml ...' );
|
|
|
|
|
|
|
|
# Push SAML request to IdP
|
|
|
|
switch ('issuer');
|
|
|
|
ok(
|
|
|
|
$res = $issuer->_get(
|
|
|
|
$url,
|
|
|
|
query => $query,
|
|
|
|
accept => 'text/html',
|
|
|
|
),
|
|
|
|
'Launch SAML request to IdP'
|
|
|
|
);
|
2016-12-23 11:02:21 +01:00
|
|
|
expectOK($res);
|
2018-07-05 23:00:40 +02:00
|
|
|
my $pdata = 'lemonldappdata=' . expectCookie( $res, 'lemonldappdata' );
|
2016-12-07 23:30:00 +01:00
|
|
|
|
|
|
|
# Try to authenticate to IdP
|
|
|
|
my $body = $res->[2]->[0];
|
|
|
|
$body =~ s/^.*?<form.*?>//s;
|
|
|
|
$body =~ s#</form>.*$##s;
|
|
|
|
my %fields =
|
|
|
|
( $body =~ /<input type="hidden".+?name="(.+?)".+?value="(.*?)"/sg );
|
2017-03-03 17:57:04 +01:00
|
|
|
$fields{user} = $fields{password} = 'french';
|
2016-12-07 23:30:00 +01:00
|
|
|
use URI::Escape;
|
|
|
|
my $s = join( '&', map { "$_=" . uri_escape( $fields{$_} ) } keys %fields );
|
|
|
|
ok(
|
|
|
|
$res = $issuer->_post(
|
|
|
|
$url,
|
|
|
|
IO::String->new($s),
|
|
|
|
accept => 'text/html',
|
2018-07-04 22:54:09 +02:00
|
|
|
cookie => $pdata,
|
2016-12-07 23:30:00 +01:00
|
|
|
length => length($s),
|
|
|
|
),
|
|
|
|
'Post authentication'
|
|
|
|
);
|
2016-12-23 11:02:21 +01:00
|
|
|
my $idpId = expectCookie($res);
|
|
|
|
( $url, $query ) = expectRedirection( $res,
|
|
|
|
qr#http://auth.sp.com(/saml/proxySingleSignOnArtifact)\?(SAMLart=[^&]+)#
|
|
|
|
);
|
2016-12-07 23:30:00 +01:00
|
|
|
|
|
|
|
# Query SP with SAML artifact
|
|
|
|
switch ('sp');
|
|
|
|
ok(
|
|
|
|
$res = $sp->_get(
|
|
|
|
$url,
|
|
|
|
query => $query,
|
|
|
|
accept => 'text/html',
|
|
|
|
length => length($s),
|
|
|
|
),
|
|
|
|
'Push artifact to SP'
|
|
|
|
);
|
2016-12-23 11:02:21 +01:00
|
|
|
my $spId = expectCookie($res);
|
|
|
|
expectRedirection( $res, 'http://auth.sp.com' );
|
2016-12-08 06:40:50 +01:00
|
|
|
|
2016-12-23 11:02:21 +01:00
|
|
|
# Verify authentication
|
2016-12-08 06:40:50 +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, 'fa@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 'Frédéric Accents', 'UTF-8 values' )
|
|
|
|
or explain( $res, 'cn => Frédéric Accents' );
|
2016-12-07 23:30:00 +01:00
|
|
|
|
2016-12-13 20:21:36 +01:00
|
|
|
# Logout initiated by SP
|
|
|
|
ok(
|
|
|
|
$res = $sp->_get(
|
|
|
|
'/',
|
|
|
|
query => 'logout',
|
|
|
|
cookie => "lemonldap=$spId",
|
|
|
|
accept => 'text/html'
|
|
|
|
),
|
|
|
|
'Query SP for logout'
|
|
|
|
);
|
2016-12-27 09:40:12 +01:00
|
|
|
expectOK($res);
|
2017-02-15 07:41:50 +01:00
|
|
|
|
|
|
|
#($url,$query)=expectRedirection($res,qr#http://auth.idp.com(/saml/singleLogout)\?(SAMLart=.*)#);
|
2016-12-27 09:40:12 +01:00
|
|
|
|
|
|
|
## Push logout artifact to IdP
|
2017-02-15 07:41:50 +01:00
|
|
|
#switch('issuer');
|
|
|
|
#ok($res=$issuer->_get($url,query=>$query,accept=>'text/html',cookie=>"lemonldap=$idpId"),'Follow redirection');
|
2016-12-14 06:51:45 +01:00
|
|
|
|
2019-11-06 18:38:58 +01:00
|
|
|
my $removedCookie = expectCookie($res);
|
|
|
|
is($removedCookie, 0, "SSO cookie removed");
|
|
|
|
|
2016-12-23 17:03:36 +01:00
|
|
|
# Test if logout is done
|
|
|
|
switch ('issuer');
|
|
|
|
ok(
|
2017-01-01 18:56:46 +01: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-07 23:30:00 +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-07 23:30:00 +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-07 23:30:00 +01:00
|
|
|
issuerDBSAMLActivation => 1,
|
|
|
|
samlSPMetaDataOptions => {
|
|
|
|
'sp.com' => {
|
2016-12-16 07:03:30 +01:00
|
|
|
samlSPMetaDataOptionsEncryptionMode => 'none',
|
|
|
|
samlSPMetaDataOptionsSignSSOMessage => 1,
|
|
|
|
samlSPMetaDataOptionsSignSLOMessage => 1,
|
|
|
|
samlSPMetaDataOptionsCheckSSOMessageSignature => 1,
|
|
|
|
samlSPMetaDataOptionsCheckSLOMessageSignature => 1,
|
2016-12-07 23:30:00 +01:00
|
|
|
}
|
|
|
|
},
|
|
|
|
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,
|
|
|
|
samlServicePrivateKeySig => saml_key_idp_private_sig,
|
|
|
|
samlServicePublicKeyEnc => saml_key_idp_public_enc,
|
|
|
|
samlServicePublicKeySig => saml_key_idp_public_sig,
|
2016-12-07 23:30:00 +01:00
|
|
|
samlSPMetaDataXML => {
|
|
|
|
"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" />
|
2016-12-27 12:17:25 +01:00
|
|
|
<SingleLogoutService Binding="urn:oasis:names:tc:SAML:2.0:bindings:SOAP"
|
|
|
|
Location="http://auth.sp.com/saml/singleLogoutSOAP" />
|
2016-12-07 23:30:00 +01:00
|
|
|
<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" />
|
2016-12-27 12:17:25 +01:00
|
|
|
<SingleLogoutService Binding="urn:oasis:names:tc:SAML:2.0:bindings:SOAP"
|
|
|
|
Location="http://auth.sp.com/saml/proxySingleLogoutSOAP" />
|
2016-12-07 23:30:00 +01:00
|
|
|
<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-07 23:30:00 +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-07 23:30:00 +01:00
|
|
|
issuerDBSAMLActivation => 0,
|
2017-03-03 17:57:04 +01:00
|
|
|
restSessionServer => 1,
|
2016-12-07 23:30:00 +01:00
|
|
|
samlIDPMetaDataExportedAttributes => {
|
|
|
|
idp => {
|
|
|
|
mail => "0;mail;;",
|
|
|
|
uid => "1;uid",
|
|
|
|
cn => "0;cn"
|
|
|
|
}
|
|
|
|
},
|
|
|
|
samlIDPMetaDataOptions => {
|
|
|
|
idp => {
|
|
|
|
samlIDPMetaDataOptionsEncryptionMode => 'none',
|
2016-12-27 09:40:12 +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-07 23:30:00 +01:00
|
|
|
}
|
|
|
|
},
|
2017-03-03 17:57:04 +01:00
|
|
|
samlIDPMetaDataExportedAttributes => {
|
|
|
|
idp => {
|
|
|
|
"uid" => "0;uid;;",
|
|
|
|
"cn" => "1;cn;;",
|
|
|
|
},
|
|
|
|
},
|
2016-12-07 23:30:00 +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,
|
|
|
|
samlServicePrivateKeyEnc => saml_key_sp_private_enc,
|
|
|
|
samlServicePrivateKeySig => saml_key_sp_private_sig,
|
|
|
|
samlServicePublicKeyEnc => saml_key_sp_public_enc,
|
2016-12-07 23:30:00 +01:00
|
|
|
samlSPSSODescriptorAuthnRequestsSigned => 1,
|
|
|
|
},
|
|
|
|
}
|
|
|
|
);
|
|
|
|
}
|