Merge branch 'v2.0'
This commit is contained in:
commit
f75093d433
|
@ -141,7 +141,7 @@ sub saveConf {
|
|||
if ( $self->{refLocalStorage} ) {
|
||||
$self->setDefault($conf);
|
||||
$self->compactConf($conf);
|
||||
$self->setLocalConf($conf);
|
||||
eval { Lemonldap::NG::Handler::Main->reload() };
|
||||
}
|
||||
|
||||
return ( $self->unlock() ? $tmp : UNKNOWN_ERROR );
|
||||
|
|
|
@ -571,7 +571,8 @@ sub authChoiceModules {
|
|||
#@return PSGI JSON response
|
||||
sub grantSessionRules {
|
||||
my ( $self, $req, $key ) = @_;
|
||||
return $self->sendError( 'Subkeys forbidden for grantSessionRules', 400 )
|
||||
return $self->sendError( $req, 'Subkeys forbidden for grantSessionRules',
|
||||
400 )
|
||||
if ($key);
|
||||
my $value = $self->getConfKey( $req, 'grantSessionRules' );
|
||||
my @res;
|
||||
|
@ -605,7 +606,7 @@ sub grantSessionRules {
|
|||
# Split openIdIDPList parameter into 2 elements
|
||||
sub openIdIDPList {
|
||||
my ( $self, $req, $key ) = @_;
|
||||
return $self->sendError( 'Subkeys forbidden for openIdIDPList', 400 )
|
||||
return $self->sendError( $req, 'Subkeys forbidden for openIdIDPList', 400 )
|
||||
if ($key);
|
||||
my $value = $self->getConfKey( $req, 'openIdIDPList' );
|
||||
$value //= '0;';
|
||||
|
@ -644,7 +645,14 @@ sub _scanCatsAndApps {
|
|||
my ( $self, $apps, $baseId ) = @_;
|
||||
my @res;
|
||||
|
||||
foreach my $cat ( grep { not /^(?:catname|type)$/ } sort keys %$apps ) {
|
||||
foreach my $cat (
|
||||
sort {
|
||||
( $apps->{$a}->{order} || 0 ) <=> ( $apps->{$b}->{order} || 0 )
|
||||
or $a cmp $b
|
||||
}
|
||||
grep { not /^(?:catname|type|order)$/ } keys %$apps
|
||||
)
|
||||
{
|
||||
my $item = { id => "$baseId/$cat" };
|
||||
if ( $apps->{$cat}->{type} eq 'category' ) {
|
||||
$item->{title} = $apps->{$cat}->{catname};
|
||||
|
@ -673,7 +681,7 @@ sub _scanCatsAndApps {
|
|||
# Returns raw value, just transform "over" key
|
||||
sub combModules {
|
||||
my ( $self, $req, $key ) = @_;
|
||||
return $self->sendError( 'Subkeys forbidden for combModules', 400 )
|
||||
return $self->sendError( $req, 'Subkeys forbidden for combModules', 400 )
|
||||
if ($key);
|
||||
my $val = $self->getConfKey( $req, 'combModules' ) // {};
|
||||
my $res = [];
|
||||
|
|
|
@ -18,8 +18,8 @@ sub fetchId {
|
|||
# time:_session_id:vhost1:vhost2,...
|
||||
my ( $t, $_session_id, @vhosts ) = split /:/, $s;
|
||||
|
||||
# At least one vhost
|
||||
unless (@vhosts) {
|
||||
# $_session_id and at least one vhost
|
||||
unless ( @vhosts and $_session_id ) {
|
||||
$class->userLogger->error('Bad service token');
|
||||
return 0;
|
||||
}
|
||||
|
@ -34,7 +34,10 @@ sub fetchId {
|
|||
|
||||
# Is token in good interval ?
|
||||
my $localConfig = $class->localConfig;
|
||||
my $ttl = $localConfig->{vhostOptions}->{$vh}->{vhostServiceTokenTTL} || $class->tsv->{handlerServiceTokenTTL};
|
||||
my $ttl =
|
||||
$localConfig->{vhostOptions}->{$vh}->{vhostServiceTokenTTL} <= 0
|
||||
? $class->tsv->{handlerServiceTokenTTL}
|
||||
: $localConfig->{vhostOptions}->{$vh}->{vhostServiceTokenTTL};
|
||||
unless ( $t <= time and $t > time - $ttl ) {
|
||||
$class->userLogger->warn('Expired service token');
|
||||
return 0;
|
||||
|
|
|
@ -28,7 +28,7 @@ init(
|
|||
|
||||
my $res;
|
||||
my $crypt = Lemonldap::NG::Common::Crypto->new('qwertyui');
|
||||
my $token = $crypt->encrypt( join ':', time, $sessionId, 'test1.example.com', 'test2.example.com' );
|
||||
my $token = $crypt->encrypt( join ':', time, $sessionId, 'test1.example.com', 'test2.example.com', '*.example.com' );
|
||||
|
||||
ok(
|
||||
$res = $client->_get(
|
||||
|
|
|
@ -3569,7 +3569,7 @@ qr/^(?:(?:(?:(?:(?:(?:[a-zA-Z0-9][-a-zA-Z0-9]*)?[a-zA-Z0-9])[.])*(?:[a-zA-Z][-a-
|
|||
'type' => 'int'
|
||||
},
|
||||
'vhostServiceTokenTTL' => {
|
||||
'default' => 30,
|
||||
'default' => -1,
|
||||
'type' => 'int'
|
||||
},
|
||||
'vhostType' => {
|
||||
|
|
|
@ -1710,7 +1710,7 @@ sub attributes {
|
|||
},
|
||||
vhostServiceTokenTTL => {
|
||||
type => 'int',
|
||||
default => 30,
|
||||
default => -1,
|
||||
},
|
||||
vhostAliases => { type => 'text', },
|
||||
vhostType => {
|
||||
|
|
|
@ -110,8 +110,8 @@ sub appListDiff {
|
|||
my ( $self, @conf ) = @_;
|
||||
my @res;
|
||||
my @keys = (
|
||||
[ sort grep { $_ !~ /^(?:catname|type)$/ } keys %{ $conf[0] } ],
|
||||
[ sort grep { $_ !~ /^(?:catname|type)$/ } keys %{ $conf[1] } ]
|
||||
[ sort grep { $_ !~ /^(?:catname|type|order)$/ } keys %{ $conf[0] } ],
|
||||
[ sort grep { $_ !~ /^(?:catname|type|order)$/ } keys %{ $conf[1] } ]
|
||||
);
|
||||
while ( my $key = shift @{ $keys[0] } ) {
|
||||
|
||||
|
|
|
@ -70,7 +70,7 @@ has confChanged => (
|
|||
);
|
||||
|
||||
# Properties required during build
|
||||
has refConf => ( is => 'ro', isa => 'HashRef', required => 1 );
|
||||
has refConf => ( is => 'ro', isa => 'HashRef', required => 1 );
|
||||
has req => ( is => 'ro', required => 1 );
|
||||
has newConf => ( is => 'rw', isa => 'HashRef' );
|
||||
has tree => ( is => 'rw', isa => 'ArrayRef' );
|
||||
|
@ -160,7 +160,7 @@ sub _scanNodes {
|
|||
hdebug("Looking to $name");
|
||||
|
||||
# subnode
|
||||
my $subNodes = $leaf->{nodes} // $leaf->{_nodes};
|
||||
my $subNodes = $leaf->{nodes} // $leaf->{_nodes};
|
||||
my $subNodesCond = $leaf->{nodes_cond} // $leaf->{_nodes_cond};
|
||||
|
||||
##################################
|
||||
|
@ -587,6 +587,22 @@ sub _scanNodes {
|
|||
$cmp = $cmp->{$cat};
|
||||
}
|
||||
|
||||
my $newapp = $app;
|
||||
|
||||
# Compute a nice name for new nodes, taking care of potential conflicts
|
||||
# For some reason, the manager sends /nNaN sometimes
|
||||
if ( $newapp =~ /^n(\d+|NaN)$/ ) {
|
||||
|
||||
# Remove all special characters
|
||||
my $baseName = $leaf->{title} =~ s/\W//gr;
|
||||
$baseName = lc $baseName;
|
||||
$newapp = $baseName;
|
||||
my $cnt = 1;
|
||||
while ( exists $cn->{$newapp} ) {
|
||||
$newapp = "${baseName}_" . $cnt++;
|
||||
}
|
||||
}
|
||||
|
||||
# Create new category
|
||||
#
|
||||
# Note that this works because nodes are ordered so "cat/cat2/app"
|
||||
|
@ -594,11 +610,14 @@ sub _scanNodes {
|
|||
if ( $leaf->{type} eq 'menuCat' ) {
|
||||
hdebug(' menu cat');
|
||||
$knownCat->{__id}++;
|
||||
my $s = $knownCat->{$app} = sprintf '%04d-cat',
|
||||
$knownCat->{__id};
|
||||
$cn->{$s} = { catname => $leaf->{title}, type => 'category' };
|
||||
$knownCat->{$app} = $newapp;
|
||||
$cn->{$newapp} = {
|
||||
catname => $leaf->{title},
|
||||
type => 'category',
|
||||
order => $knownCat->{__id}
|
||||
};
|
||||
unless ($cmp->{$app}
|
||||
and $cmp->{$app}->{catname} eq $cn->{$s}->{catname} )
|
||||
and $cmp->{$app}->{catname} eq $cn->{$newapp}->{catname} )
|
||||
{
|
||||
$self->confChanged(1);
|
||||
push @{ $self->changes },
|
||||
|
@ -606,15 +625,17 @@ sub _scanNodes {
|
|||
key => join(
|
||||
', ', 'applicationList', @path, $leaf->{title}
|
||||
),
|
||||
new => $cn->{$s}->{catname},
|
||||
old => ( $cn->{$s} ? $cn->{$s}->{catname} : undef )
|
||||
new => $cn->{$newapp}->{catname},
|
||||
old => (
|
||||
$cn->{$newapp} ? $cn->{$newapp}->{catname} : undef
|
||||
)
|
||||
};
|
||||
}
|
||||
if ( ref $subNodes ) {
|
||||
$self->_scanNodes($subNodes) or return 0;
|
||||
}
|
||||
my @listCatRef = keys %{ $cmp->{$app} };
|
||||
my @listCatNew = keys %{ $cn->{$s} };
|
||||
my @listCatNew = keys %{ $cn->{$newapp} };
|
||||
|
||||
# Check for deleted
|
||||
unless ( @listCatRef == @listCatNew ) {
|
||||
|
@ -631,10 +652,12 @@ sub _scanNodes {
|
|||
else {
|
||||
hdebug(' new app');
|
||||
$knownCat->{__id}++;
|
||||
my $name = sprintf( '%04d-app', $knownCat->{__id} );
|
||||
$cn->{$name} =
|
||||
{ type => 'application', options => $leaf->{data} };
|
||||
$cn->{$name}->{options}->{name} = $leaf->{title};
|
||||
$cn->{$newapp} = {
|
||||
type => 'application',
|
||||
options => $leaf->{data},
|
||||
order => $knownCat->{__id}
|
||||
};
|
||||
$cn->{$newapp}->{options}->{name} = $leaf->{title};
|
||||
unless ( $cmp->{$app} ) {
|
||||
$self->confChanged(1);
|
||||
push @{ $self->changes },
|
||||
|
@ -644,9 +667,17 @@ sub _scanNodes {
|
|||
};
|
||||
}
|
||||
else {
|
||||
foreach my $k ( keys %{ $cn->{$name}->{options} } ) {
|
||||
# Check for change in ordering
|
||||
if ( ( $cn->{$newapp}->{order} || 0 ) !=
|
||||
( $cmp->{$newapp}->{order} || 0 ) )
|
||||
{
|
||||
$self->confChanged(1);
|
||||
}
|
||||
|
||||
# Check for change in options
|
||||
foreach my $k ( keys %{ $cn->{$newapp}->{options} } ) {
|
||||
unless ( $cmp->{$app}->{options}->{$k} eq
|
||||
$cn->{$name}->{options}->{$k} )
|
||||
$cn->{$newapp}->{options}->{$k} )
|
||||
{
|
||||
$self->confChanged(1);
|
||||
push @{ $self->changes },
|
||||
|
@ -654,7 +685,7 @@ sub _scanNodes {
|
|||
key => join( ', ',
|
||||
'applicationList', @path,
|
||||
$leaf->{title}, $k ),
|
||||
new => $cn->{$name}->{options}->{$k},
|
||||
new => $cn->{$newapp}->{options}->{$k},
|
||||
old => $cmp->{$app}->{options}->{$k}
|
||||
};
|
||||
}
|
||||
|
@ -1070,14 +1101,14 @@ sub _unitTest {
|
|||
or $attr->{type} =~ /Container$/ )
|
||||
{
|
||||
my $keyMsg = $attr->{keyMsgFail} // $type->{keyMsgFail};
|
||||
my $msg = $attr->{msgFail} // $type->{msgFail};
|
||||
my $msg = $attr->{msgFail} // $type->{msgFail};
|
||||
$res = 0
|
||||
unless (
|
||||
$self->_execTest( {
|
||||
keyTest => $attr->{keyTest} // $type->{keyTest},
|
||||
keyTest => $attr->{keyTest} // $type->{keyTest},
|
||||
keyMsgFail => $attr->{keyMsgFail}
|
||||
// $type->{keyMsgFail},
|
||||
test => $attr->{test} // $type->{test},
|
||||
test => $attr->{test} // $type->{test},
|
||||
msgFail => $attr->{msgFail} // $type->{msgFail},
|
||||
},
|
||||
$conf->{$key},
|
||||
|
|
|
@ -1205,7 +1205,7 @@ function templates(tpl,key) {
|
|||
"type" : "int"
|
||||
},
|
||||
{
|
||||
"default" : 30,
|
||||
"default" : -1,
|
||||
"get" : tpl+"s/"+key+"/"+"vhostServiceTokenTTL",
|
||||
"id" : tpl+"s/"+key+"/"+"vhostServiceTokenTTL",
|
||||
"title" : "vhostServiceTokenTTL",
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -1,7 +1,6 @@
|
|||
{
|
||||
"applicationList": {
|
||||
"0001-cat": {
|
||||
"catname": "Sample applications",
|
||||
"0002-app": {
|
||||
"options": {
|
||||
"description": "A simple application displaying authenticated user",
|
||||
|
@ -10,6 +9,7 @@
|
|||
"name": "Application Test 1",
|
||||
"uri": "http://test1.example.com/"
|
||||
},
|
||||
"order": 2,
|
||||
"type": "application"
|
||||
},
|
||||
"0003-app": {
|
||||
|
@ -20,12 +20,14 @@
|
|||
"name": "Application Test 2",
|
||||
"uri": "http://test2.example.com/"
|
||||
},
|
||||
"order": 3,
|
||||
"type": "application"
|
||||
},
|
||||
"catname": "Sample applications",
|
||||
"order": 1,
|
||||
"type": "category"
|
||||
},
|
||||
"0004-cat": {
|
||||
"catname": "Administration",
|
||||
"0005-app": {
|
||||
"options": {
|
||||
"description": "Configure LemonLDAP::NG WebSSO",
|
||||
|
@ -34,6 +36,7 @@
|
|||
"name": "WebSSO Manager",
|
||||
"uri": "http://manager.example.com/"
|
||||
},
|
||||
"order": 5,
|
||||
"type": "application"
|
||||
},
|
||||
"0006-app": {
|
||||
|
@ -44,6 +47,7 @@
|
|||
"name": "Notifications explorer",
|
||||
"uri": "http://manager.example.com/notifications"
|
||||
},
|
||||
"order": 6,
|
||||
"type": "application"
|
||||
},
|
||||
"0007-app": {
|
||||
|
@ -54,12 +58,14 @@
|
|||
"name": "Sessions explorer",
|
||||
"uri": "http://manager.example.com/sessions"
|
||||
},
|
||||
"order": 7,
|
||||
"type": "application"
|
||||
},
|
||||
"catname": "Administration",
|
||||
"order": 4,
|
||||
"type": "category"
|
||||
},
|
||||
"0008-cat": {
|
||||
"catname": "Documentation",
|
||||
"0009-app": {
|
||||
"options": {
|
||||
"description": "Documentation supplied with LemonLDAP::NG",
|
||||
|
@ -68,6 +74,7 @@
|
|||
"name": "Local documentation",
|
||||
"uri": "http://manager.example.com/doc/"
|
||||
},
|
||||
"order": 9,
|
||||
"type": "application"
|
||||
},
|
||||
"0010-app": {
|
||||
|
@ -78,8 +85,11 @@
|
|||
"name": "Official Website",
|
||||
"uri": "http://lemonldap-ng.org/"
|
||||
},
|
||||
"order": 10,
|
||||
"type": "application"
|
||||
},
|
||||
"catname": "Documentation",
|
||||
"order": 8,
|
||||
"type": "category"
|
||||
}
|
||||
},
|
||||
|
@ -104,8 +114,7 @@
|
|||
"Auth-User": "$uid"
|
||||
}
|
||||
},
|
||||
"exportedVars": {
|
||||
},
|
||||
"exportedVars": {},
|
||||
"globalStorage": "Apache::Session::File",
|
||||
"globalStorageOptions": {
|
||||
"Directory": "t/sessions",
|
||||
|
@ -132,11 +141,11 @@
|
|||
"_whatToTrace": "$_auth eq 'SAML' ? \"$_user\\@$_idpConfKey\" : \"$_user\""
|
||||
},
|
||||
"notification": 1,
|
||||
"oldNotifFormat": 0,
|
||||
"notificationStorage": "File",
|
||||
"notificationStorageOptions": {
|
||||
"dirName": "t/notifications"
|
||||
},
|
||||
"oldNotifFormat": 0,
|
||||
"passwordDB": "Demo",
|
||||
"persistentStorage": "Apache::Session::File",
|
||||
"persistentStorageOptions": {
|
||||
|
|
|
@ -251,6 +251,7 @@ site/htdocs/static/common/de.png
|
|||
site/htdocs/static/common/en.png
|
||||
site/htdocs/static/common/es.png
|
||||
site/htdocs/static/common/favicon.ico
|
||||
site/htdocs/static/common/fi.png
|
||||
site/htdocs/static/common/fr.png
|
||||
site/htdocs/static/common/icons/application_cascade.png
|
||||
site/htdocs/static/common/icons/arrow_refresh.png
|
||||
|
@ -446,6 +447,7 @@ t/30-Auth-and-issuer-SAML-Redirect.t
|
|||
t/30-Auth-SAML-with-choice.t
|
||||
t/30-CDC.t
|
||||
t/30-SAML-Head-to-Tail-POST.t
|
||||
t/30-SAML-POST-Logout-when-expired.t
|
||||
t/30-SAML-ReAuth-with-choice.t
|
||||
t/30-SAML-ReAuth.t
|
||||
t/30-SAML-SP-rule.t
|
||||
|
@ -511,6 +513,10 @@ t/43-MailPasswordReset-with-captcha.t
|
|||
t/43-MailPasswordReset-with-token.t
|
||||
t/43-MailPasswordReset.t
|
||||
t/50-IssuerGet.t
|
||||
t/59-Double-cookies-for-a-Single-session.t
|
||||
t/59-Double-cookies-for-Double-sessions.t
|
||||
t/59-Double-cookies-Refresh-and-Logout.t
|
||||
t/59-Secured-cookie-Refresh-and-Logout.t
|
||||
t/60-Status.t
|
||||
t/61-BruteForceProtection.t
|
||||
t/61-ForceAuthn.t
|
||||
|
@ -531,11 +537,7 @@ t/67-CheckUser.t
|
|||
t/68-Impersonation-with-doubleCookies.t
|
||||
t/68-Impersonation-with-merge.t
|
||||
t/68-Impersonation.t
|
||||
t/69-Double-cookies-for-a-Single-session.t
|
||||
t/69-Double-cookies-for-Double-sessions.t
|
||||
t/69-Double-cookies-Refresh-and-Logout.t
|
||||
t/69-FavApps.t
|
||||
t/69-HTTPS-cookie-Refresh-and-Logout.t
|
||||
t/70-2F-TOTP-with-History.t
|
||||
t/70-2F-TOTP.t
|
||||
t/70-2F-TOTP_8.t
|
||||
|
|
|
@ -996,13 +996,13 @@ sub token {
|
|||
$self->logger->error(
|
||||
"Relying Party $rp is confidential but no client secret was provided to authenticate on token endpoint"
|
||||
);
|
||||
return $self->p->sendError( 'invalid_request', 400 );
|
||||
return $self->p->sendError( $req, 'invalid_request', 400 );
|
||||
}
|
||||
unless ( $client_secret eq $self->conf->{oidcRPMetaDataOptions}->{$rp}
|
||||
->{oidcRPMetaDataOptionsClientSecret} )
|
||||
{
|
||||
$self->logger->error("Wrong credentials for $rp");
|
||||
return $self->p->sendError( 'invalid_request', 400 );
|
||||
return $self->p->sendError( $req, 'invalid_request', 400 );
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1617,7 +1617,7 @@ sub sloServer {
|
|||
|
||||
unless ($local_session) {
|
||||
$self->logger->error("No local session found");
|
||||
return $self->sendSLOErrorResponse( $logout, $method );
|
||||
return $self->sendSLOErrorResponse( $req, $logout, $method );
|
||||
}
|
||||
|
||||
# Load Session and Identity if they exist
|
||||
|
@ -1668,7 +1668,7 @@ sub sloServer {
|
|||
}
|
||||
|
||||
# Check Destination
|
||||
return $self->sendSLOErrorResponse( $logout, $method )
|
||||
return $self->sendSLOErrorResponse( $req, $logout, $method )
|
||||
unless ( $self->checkDestination( $logout->request, $url ) );
|
||||
|
||||
# Validate request if no previous error
|
||||
|
@ -1718,7 +1718,7 @@ sub sloServer {
|
|||
|
||||
unless ($signSLOMessage) {
|
||||
$self->logger->debug("Do not sign this SLO response");
|
||||
return $self->sendSLOErrorResponse( $logout, $method )
|
||||
return $self->sendSLOErrorResponse( $req, $logout, $method )
|
||||
unless ( $self->disableSignature($logout) );
|
||||
}
|
||||
|
||||
|
|
|
@ -234,7 +234,7 @@ sub _buildCategoryHash {
|
|||
# Extract applications from hash
|
||||
my $apphash;
|
||||
foreach my $catkey ( sort keys %$cathash ) {
|
||||
next if $catkey =~ /(type|options|catname)/;
|
||||
next if $catkey =~ /(type|options|catname|order)/;
|
||||
if ( $cathash->{$catkey}->{type} eq "application" ) {
|
||||
$apphash->{$catkey} = $cathash->{$catkey};
|
||||
}
|
||||
|
@ -242,15 +242,29 @@ sub _buildCategoryHash {
|
|||
|
||||
# Display applications first
|
||||
if ( scalar keys %$apphash > 0 ) {
|
||||
foreach my $appkey ( sort keys %$apphash ) {
|
||||
foreach my $appkey (
|
||||
sort {
|
||||
($apphash->{$a}->{order} || 0) <=> ($apphash->{$b}->{order} || 0)
|
||||
or $a cmp $b
|
||||
}
|
||||
keys %$apphash
|
||||
)
|
||||
{
|
||||
push @$applications,
|
||||
$self->_buildApplicationHash( $appkey, $apphash->{$appkey} );
|
||||
}
|
||||
}
|
||||
|
||||
# Display subcategories
|
||||
foreach my $catkey ( sort keys %$cathash ) {
|
||||
next if $catkey =~ /(type|options|catname)/;
|
||||
foreach my $catkey (
|
||||
sort {
|
||||
($cathash->{$a}->{order} || 0) <=> ($cathash->{$b}->{order} || 0)
|
||||
or $a cmp $b
|
||||
}
|
||||
grep { not /^(?:catname|type|options|order)$/ } keys %$cathash
|
||||
)
|
||||
{
|
||||
|
||||
if ( $cathash->{$catkey}->{type} eq "category" ) {
|
||||
push @$categories,
|
||||
$self->_buildCategoryHash( $req, $catkey, $cathash->{$catkey},
|
||||
|
@ -288,7 +302,7 @@ sub _buildApplicationHash {
|
|||
# Detect sub applications
|
||||
my $subapphash;
|
||||
foreach my $key ( sort keys %$apphash ) {
|
||||
next if $key =~ /(type|options|catname)/;
|
||||
next if $key =~ /(type|options|catname|order)/;
|
||||
if ( $apphash->{$key}->{type} eq "application" ) {
|
||||
$subapphash->{$key} = $apphash->{$key};
|
||||
}
|
||||
|
@ -296,7 +310,14 @@ sub _buildApplicationHash {
|
|||
|
||||
# Display sub applications
|
||||
if ( scalar keys %$subapphash > 0 ) {
|
||||
foreach my $appkey ( sort keys %$subapphash ) {
|
||||
foreach my $appkey (
|
||||
sort {
|
||||
($subapphash->{$a}->{order} || 0) <=> ( $subapphash->{$b}->{order} || 0 )
|
||||
or $a cmp $b
|
||||
}
|
||||
keys %$subapphash
|
||||
)
|
||||
{
|
||||
push @$applications,
|
||||
$self->_buildApplicationHash( $appkey, $subapphash->{$appkey} );
|
||||
}
|
||||
|
@ -347,7 +368,7 @@ sub _filter {
|
|||
sub _filterHash {
|
||||
my ( $self, $req, $apphash, $favAppslistRef ) = @_;
|
||||
foreach my $key ( keys %$apphash ) {
|
||||
next if $key =~ /(type|options|catname)/;
|
||||
next if $key =~ /(type|options|catname|order)/;
|
||||
if ( $apphash->{$key}->{type}
|
||||
and $apphash->{$key}->{type} eq "category" )
|
||||
{
|
||||
|
@ -361,7 +382,7 @@ sub _filterHash {
|
|||
|
||||
# Find sub applications and filter them
|
||||
foreach my $appkey ( keys %{ $apphash->{$key} } ) {
|
||||
next if $appkey =~ /(type|options|catname)/;
|
||||
next if $appkey =~ /(type|options|catname|order)/;
|
||||
|
||||
# We have sub elements, so we filter them
|
||||
$self->_filterHash( $req, $apphash->{$key}, $favAppslistRef );
|
||||
|
@ -445,7 +466,7 @@ sub _isCategoryEmpty {
|
|||
|
||||
# Test sub categories
|
||||
foreach $key ( keys %$apphash ) {
|
||||
next if $key =~ /(type|options|catname)/;
|
||||
next if $key =~ /(type|options|catname|order)/;
|
||||
if ( $apphash->{$key}->{type}
|
||||
and $apphash->{$key}->{type} eq "category" )
|
||||
{
|
||||
|
@ -460,10 +481,12 @@ sub _isCategoryEmpty {
|
|||
# Temporary store 'options'
|
||||
my $tmp_options = $apphash->{options};
|
||||
my $tmp_catname = $apphash->{catname};
|
||||
my $tmp_order = $apphash->{order};
|
||||
|
||||
delete $apphash->{type};
|
||||
delete $apphash->{options};
|
||||
delete $apphash->{catname};
|
||||
delete $apphash->{order};
|
||||
|
||||
if ( scalar( keys %$apphash ) ) {
|
||||
|
||||
|
@ -472,6 +495,7 @@ sub _isCategoryEmpty {
|
|||
$apphash->{type} = "category";
|
||||
$apphash->{options} = $tmp_options;
|
||||
$apphash->{catname} = $tmp_catname;
|
||||
$apphash->{order} = $tmp_order;
|
||||
|
||||
# Return false
|
||||
return 0;
|
||||
|
|
|
@ -154,7 +154,8 @@ sub refresh {
|
|||
delete $data{$_} unless ( /^_/ or /^(?:startTime)$/ );
|
||||
}
|
||||
$data{_updateTime} = strftime( "%Y%m%d%H%M%S", localtime() );
|
||||
$self->logger->debug( "Set session $req->{id} _updateTime with $data{_updateTime}" );
|
||||
$self->logger->debug(
|
||||
"Set session $req->{id} _updateTime with $data{_updateTime}");
|
||||
$req->steps( [
|
||||
'getUser',
|
||||
@{ $self->betweenAuthAndData },
|
||||
|
@ -874,7 +875,7 @@ sub lmError {
|
|||
|
||||
# Check URL
|
||||
$self->controlUrl($req);
|
||||
$req->pdata( {} );
|
||||
$req->pdata( {} ) unless ( $httpError == 404 );
|
||||
|
||||
if ( $req->wantJSON ) {
|
||||
return $self->sendJSONresponse(
|
||||
|
|
|
@ -15,10 +15,10 @@ sub init { 1 }
|
|||
|
||||
sub run {
|
||||
my ( $self, $req ) = @_;
|
||||
my $deleted = [];
|
||||
my $otherSessions = [];
|
||||
|
||||
my $moduleOptions = $self->conf->{globalStorageOptions} || {};
|
||||
my $deleted = [];
|
||||
my $otherSessions = [];
|
||||
my $linkedSessionId = '';
|
||||
my $moduleOptions = $self->conf->{globalStorageOptions} || {};
|
||||
$moduleOptions->{backend} = $self->conf->{globalStorage};
|
||||
|
||||
my $sessions = $self->module->searchOn(
|
||||
|
@ -26,8 +26,20 @@ sub run {
|
|||
$self->conf->{whatToTrace},
|
||||
$req->{sessionInfo}->{ $self->conf->{whatToTrace} }
|
||||
);
|
||||
|
||||
if ( $self->conf->{securedCookie} == 2 ) {
|
||||
$self->logger->debug("Looking for double sessions...");
|
||||
$linkedSessionId = $sessions->{ $req->id }->{_httpSession};
|
||||
my $msg =
|
||||
$linkedSessionId
|
||||
? "Linked session found -> $linkedSessionId / " . $req->id
|
||||
: "NO linked session found!";
|
||||
$self->logger->debug($msg);
|
||||
}
|
||||
|
||||
foreach my $id ( keys %$sessions ) {
|
||||
next if ( $req->id eq $id );
|
||||
next if ( $linkedSessionId and $id eq $linkedSessionId );
|
||||
my $session = $self->p->getApacheSession($id) or next;
|
||||
if (
|
||||
$self->conf->{singleSession}
|
||||
|
|
|
@ -0,0 +1,465 @@
|
|||
use lib 'inc';
|
||||
use Test::More;
|
||||
use strict;
|
||||
use IO::String;
|
||||
use LWP::UserAgent;
|
||||
use LWP::Protocol::PSGI;
|
||||
use MIME::Base64;
|
||||
|
||||
BEGIN {
|
||||
require 't/test-lib.pm';
|
||||
require 't/saml-lib.pm';
|
||||
}
|
||||
|
||||
my $maintests = 18;
|
||||
my $debug = 'error';
|
||||
my $timeout = 6;
|
||||
my ( $issuer, $sp, $res );
|
||||
my %handlerOR = ( issuer => [], sp => [] );
|
||||
|
||||
# Redefine LWP methods for tests
|
||||
LWP::Protocol::PSGI->register(
|
||||
sub {
|
||||
my $req = Plack::Request->new(@_);
|
||||
fail('POST should not launch SOAP requests');
|
||||
count(1);
|
||||
return [ 500, [], [] ];
|
||||
}
|
||||
);
|
||||
|
||||
SKIP: {
|
||||
eval "use Lasso";
|
||||
if ($@) {
|
||||
skip 'Lasso not found', $maintests;
|
||||
}
|
||||
|
||||
# Initialization
|
||||
ok( $issuer = issuer(), 'Issuer portal' );
|
||||
$handlerOR{issuer} = \@Lemonldap::NG::Handler::Main::_onReload;
|
||||
switch ('sp');
|
||||
&Lemonldap::NG::Handler::Main::cfgNum( 0, 0 );
|
||||
|
||||
ok( $sp = sp(), 'SP portal' );
|
||||
$handlerOR{sp} = \@Lemonldap::NG::Handler::Main::_onReload;
|
||||
|
||||
# Simple SP access
|
||||
my $res;
|
||||
ok(
|
||||
$res = $sp->_get(
|
||||
'/', accept => 'text/html',
|
||||
),
|
||||
'Unauth SP request'
|
||||
);
|
||||
expectOK($res);
|
||||
ok( expectCookie( $res, 'lemonldapidp' ), 'IDP cookie defined' )
|
||||
or explain(
|
||||
$res->[1],
|
||||
'Set-Cookie => lemonldapidp=http://auth.idp.com/saml/metadata; domain=.sp.com; path=/'
|
||||
);
|
||||
my ( $host, $url, $s ) =
|
||||
expectAutoPost( $res, 'auth.idp.com', '/saml/singleSignOn',
|
||||
'SAMLRequest' );
|
||||
|
||||
# Push SAML request to IdP
|
||||
switch ('issuer');
|
||||
ok(
|
||||
$res = $issuer->_post(
|
||||
$url,
|
||||
IO::String->new($s),
|
||||
accept => 'text/html',
|
||||
length => length($s)
|
||||
),
|
||||
'Post SAML request to IdP'
|
||||
);
|
||||
expectOK($res);
|
||||
my $pdata = 'lemonldappdata=' . expectCookie( $res, 'lemonldappdata' );
|
||||
|
||||
# Try to authenticate with an unauthorized user to IdP
|
||||
$s = "user=dwho&password=dwho&$s";
|
||||
ok(
|
||||
$res = $issuer->_post(
|
||||
$url,
|
||||
IO::String->new($s),
|
||||
accept => 'text/html',
|
||||
cookie => $pdata,
|
||||
length => length($s),
|
||||
),
|
||||
'Post authentication'
|
||||
);
|
||||
ok( $res->[2]->[0] =~ /trmsg="89"/, 'Reject reason is 89' )
|
||||
or print STDERR Dumper( $res->[2]->[0] );
|
||||
|
||||
# Simple SP access
|
||||
ok(
|
||||
$res = $sp->_get(
|
||||
'/', accept => 'text/html',
|
||||
),
|
||||
'Unauth SP request'
|
||||
);
|
||||
expectOK($res);
|
||||
ok( expectCookie( $res, 'lemonldapidp' ), 'IDP cookie defined' )
|
||||
or explain(
|
||||
$res->[1],
|
||||
'Set-Cookie => lemonldapidp=http://auth.idp.com/saml/metadata; domain=.sp.com; path=/'
|
||||
);
|
||||
( $host, $url, $s ) =
|
||||
expectAutoPost( $res, 'auth.idp.com', '/saml/singleSignOn',
|
||||
'SAMLRequest' );
|
||||
|
||||
# Push SAML request to IdP
|
||||
ok(
|
||||
$res = $issuer->_post(
|
||||
$url,
|
||||
IO::String->new($s),
|
||||
accept => 'text/html',
|
||||
length => length($s)
|
||||
),
|
||||
'Post SAML request to IdP'
|
||||
);
|
||||
expectOK($res);
|
||||
$pdata = 'lemonldappdata=' . expectCookie( $res, 'lemonldappdata' );
|
||||
|
||||
# Try to authenticate with an authorized user to IdP
|
||||
$s = "user=french&password=french&$s";
|
||||
ok(
|
||||
$res = $issuer->_post(
|
||||
$url,
|
||||
IO::String->new($s),
|
||||
accept => 'text/html',
|
||||
cookie => $pdata,
|
||||
length => length($s),
|
||||
),
|
||||
'Post authentication'
|
||||
);
|
||||
my $idpId = expectCookie($res);
|
||||
|
||||
# Expect pdata to be cleared
|
||||
$pdata = expectCookie( $res, 'lemonldappdata' );
|
||||
ok( $pdata !~ 'issuerRequestsaml', 'SAML request cleared from pdata' );
|
||||
|
||||
( $host, $url, $s ) =
|
||||
expectAutoPost( $res, 'auth.sp.com', '/saml/proxySingleSignOnPost',
|
||||
'SAMLResponse' );
|
||||
|
||||
# Post SAML response to SP
|
||||
switch ('sp');
|
||||
ok(
|
||||
$res = $sp->_post(
|
||||
$url, IO::String->new($s),
|
||||
accept => 'text/html',
|
||||
length => length($s),
|
||||
cookie => 'lemonldapidp=http://auth.idp.com/saml/metadata',
|
||||
),
|
||||
'Post SAML response to SP'
|
||||
);
|
||||
|
||||
# Verify authentication on SP
|
||||
expectRedirection( $res, 'http://auth.sp.com' );
|
||||
my $spId = expectCookie($res);
|
||||
|
||||
ok( $res = $sp->_get( '/', cookie => "lemonldap=$spId" ), 'Get / on SP' );
|
||||
expectOK($res);
|
||||
expectAuthenticatedAs( $res, 'fa@badwolf.org@idp' );
|
||||
|
||||
# Logout initiated by SP
|
||||
ok(
|
||||
$res = $sp->_get(
|
||||
'/',
|
||||
query => 'logout',
|
||||
cookie => "lemonldap=$spId",
|
||||
accept => 'text/html'
|
||||
),
|
||||
'Query SP for logout'
|
||||
);
|
||||
( $host, $url, $s ) =
|
||||
expectAutoPost( $res, 'auth.idp.com', '/saml/singleLogout',
|
||||
'SAMLRequest' );
|
||||
|
||||
diag 'Waiting';
|
||||
sleep $timeout + 1;
|
||||
|
||||
# Push SAML logout request to IdP
|
||||
switch ('issuer');
|
||||
ok(
|
||||
$res = $issuer->_post(
|
||||
$url,
|
||||
IO::String->new($s),
|
||||
accept => 'text/html',
|
||||
cookie => "lemonldap=$idpId",
|
||||
length => length($s)
|
||||
),
|
||||
'Post SAML logout request to IdP'
|
||||
);
|
||||
( $host, $url, $s ) =
|
||||
expectAutoPost( $res, 'auth.sp.com', '/saml/proxySingleLogoutReturn',
|
||||
'SAMLResponse' );
|
||||
|
||||
# Post SAML response to SP
|
||||
switch ('sp');
|
||||
ok(
|
||||
$res = $sp->_post(
|
||||
$url, IO::String->new($s),
|
||||
accept => 'text/html',
|
||||
length => length($s),
|
||||
cookie => 'lemonldapidp=http://auth.idp.com/saml/metadata',
|
||||
),
|
||||
'Post SAML response to SP'
|
||||
);
|
||||
ok($res->[2]->[0] =~ /trmsg="56"/, 'Found SLO error');
|
||||
}
|
||||
|
||||
count($maintests);
|
||||
clean_sessions();
|
||||
done_testing( count() );
|
||||
|
||||
sub switch {
|
||||
my $type = shift;
|
||||
@Lemonldap::NG::Handler::Main::_onReload = @{
|
||||
$handlerOR{$type};
|
||||
};
|
||||
}
|
||||
|
||||
sub issuer {
|
||||
return LLNG::Manager::Test->new( {
|
||||
ini => {
|
||||
timeout => $timeout,
|
||||
logLevel => $debug,
|
||||
domain => 'idp.com',
|
||||
portal => 'http://auth.idp.com',
|
||||
authentication => 'Demo',
|
||||
userDB => 'Same',
|
||||
issuerDBSAMLActivation => 1,
|
||||
issuerDBSAMLRule => '$uid eq "french"',
|
||||
samlSPMetaDataOptions => {
|
||||
'sp.com' => {
|
||||
samlSPMetaDataOptionsEncryptionMode => 'none',
|
||||
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/",
|
||||
samlServicePrivateKeyEnc => "-----BEGIN RSA PRIVATE KEY-----
|
||||
MIIEogIBAAKCAQEAnfKBDG/K0TnGT7Xu8q1N45sNWvIK91SqNg8nvN2uVeKoHADT
|
||||
csus5Xn3id5+8Q9TuMFsW9kIEeXiaPKXQa9ryfSNDhWDWloNkpGEeWif2BnHUu46
|
||||
Abu1UBWb0mH6VwcG1PR4qHruLis1odjQ1qnVDNfSEASVIppEBYjDX203ypmURIzU
|
||||
6h53GRRRlf1BLWkbVn9ysmDeR57Xw5Rsx/+tBlcnMrkv/40DSUkehQIl2JmlFrl2
|
||||
Caik+gU4pd20apA/pNLjBZF0OmGoS08AIR5NMd0KFa6CwZUUSHJqH5GFy5Y2yl4l
|
||||
g8K0klAS9q7L7aXI+eFQZhkwidjpxXnHPyxIGQIDAQABAoIBAHnfqjX3eO8SfnP5
|
||||
NURp90Td2mNHirCn0qLd9NKl1ySMPR1GgeH9SQ7Umu32EcteAUL5dOw2PiTZVmeW
|
||||
cKINgsWVftXUQcOQ4xIqWKb51QUBdy0FhxrZRSFjWxXt5iYK1PmzHfsax/g1/S9C
|
||||
RnqtFyjOy1bywkSt9jiy+9YBR2B7BDhLHlILbijWn5zaecaV4YA+L1UK4M/mehdb
|
||||
+0FVPavbGpnlqBRTY+7YXfZ/mRPCfn5DvO9lW1O0pJMmNdBh9kmm3DxHf6AkK47a
|
||||
43gO/dRWiWo2rZ/+Jw7uyqOb23U0MydP7kia0p3tzCUBPsrlgnichYG5RNFp0wqy
|
||||
3VT1TYECgYEA0Y9vENy1jJd+s7WbGrsRtSKxfZgtJr0yjSlQVYrIlwbZSGn+ndxq
|
||||
V2vVlwIgLX3pz6T40BMfk6SNx08jjy0Sgn6OAM0ILrinno8yWcSAMCmfCU0S/3O1
|
||||
55bqtcnk4XTHBHzJ5OrnrPaW5ourvJz0lcWEKMg3BXxLzaF6ZRy85nECgYEAwPMD
|
||||
LNAKLCDrUMyYFOpPyPLe7wvszcFvPipGgerSgFP1c6N7xaMUdHDYqBfuis1khPGF
|
||||
YcMHeNBYmzX6yEGbp3lrB4PHpUySmTU3mv3u9I05aahInK21gXum3uRkCWyyIF6V
|
||||
T/qeszl9mVOCp0CC4eG3IMVpaD0UKDEHVhERYCkCgYAjuTPRyA4a3Wh38ilysRkf
|
||||
q75eDqcDx5Tqg3RyYKo5NK2troP9HSnzpSpQB8i8eI53G0RfFCN5479XjqIdMi3J
|
||||
mRFUCZ+vd0L7wKVwsBK6Ix49U6o9adhElnGEc9pUpLeYiD1SjMjZr1+iBYVNLeRz
|
||||
86vH1/mpMbsqXrCis/dvwQKBgGttomHr/w3s0jftget7PirrFrbP0+wHfDGHhjRF
|
||||
kyhCFtJovrwefYALaIXGtVjw3LusYZA570oT7pGUb2naJZkMYEwR0jG1vZWx7KDO
|
||||
K6JbkxDB0pPxn7JVL2bAkPYyX8boAohCSOQO6WBZ/8+xem3bp4OGhpa0EyoBik0g
|
||||
OaVpAoGATj4SyYsE10hGT676iie8zy3fi5IPC3E+x4QlVuusaLtuY8LJA50stjtx
|
||||
gUa/JAKlZZL+gvzvOviQIxyfIChXOdTt5uiOYkdHJDbAF3NSrji7hrXq4v8UZv75
|
||||
8hBrwJZIpy6y01dRlrriHmPRtEq1pk7JX2uUg0sP5g4BEcsaCbc=
|
||||
-----END RSA PRIVATE KEY-----
|
||||
",
|
||||
samlServicePrivateKeySig => "-----BEGIN RSA PRIVATE KEY-----
|
||||
MI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VXadG6fNWWAlpgdCm9houhHb5BF
|
||||
3zge/bTr0anUe9EA7Z/ymav12rEouoNjIlhI9C5DAoGATR85a2SMt8/TB0owwdJu
|
||||
62GpZNkLCmcJkXkvaecUVAOSi2hdI4o4MwMRkK35cbX5rH74y4JqCtQY5pefgP53
|
||||
sykzDAK+MyMdzxGg2764MRGegI5Yq+5jDmSquo+xF+q6srEtRk6iMG7UVwosBLmu
|
||||
zuxqzySoiOfKSRKWnYe3SakCgYEAwWMkVkAmETXE4oDzFSsS8/mW2l//mPocTTK3
|
||||
JWe1CunJ6+8FYbAlZJEW2ngismp8+CoXybNVpbZ+pC7buKoMf6EHUgCNt0pEEFO0
|
||||
mCG9KSMk0XlPWXpArP9S4yaUq1itpzSz7QYZES+4rIcU0HLz9RgeWFyCTJWaFErc
|
||||
7laVG9sCgYBKOtk5WlIOP4BxSd2y4cYzohgwTZIs1/2kTEn1u4eH73M1xvAlHHFB
|
||||
wSF5QXgDKJ8pPAOhNWpdLO/PdtnQn91nOvTNc+ShJZzjdbneUdQVpWpoBf72uA+N
|
||||
6rIVf1JBUL2p7HFHaGdUZC7KGQ+yv6ZHrE1+7202nuDvJdvGEEdFsQ==
|
||||
-----END RSA PRIVATE KEY-----
|
||||
",
|
||||
samlServicePublicKeyEnc => "-----BEGIN PUBLIC KEY-----
|
||||
MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAnfKBDG/K0TnGT7Xu8q1N
|
||||
45sNWvIK91SqNg8nvN2uVeKoHADTcsus5Xn3id5+8Q9TuMFsW9kIEeXiaPKXQa9r
|
||||
yfSNDhWDWloNkpGEeWif2BnHUu46Abu1UBWb0mH6VwcG1PR4qHruLis1odjQ1qnV
|
||||
DNfSEASVIppEBYjDX203ypmURIzU6h53GRRRlf1BLWkbVn9ysmDeR57Xw5Rsx/+t
|
||||
BlcnMrkv/40DSUkehQIl2JmlFrl2Caik+gU4pd20apA/pNLjBZF0OmGoS08AIR5N
|
||||
Md0KFa6CwZUUSHJqH5GFy5Y2yl4lg8K0klAS9q7L7aXI+eFQZhkwidjpxXnHPyxI
|
||||
GQIDAQAB
|
||||
-----END PUBLIC KEY-----
|
||||
",
|
||||
samlServicePublicKeySig => "-----BEGIN PUBLIC KEY-----
|
||||
MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAtR/wgDqWB4Maho5V6Tjc
|
||||
L/NbNfjgIh7GcgkrB5RZcVT1GTejJlMjUQdgBKBuZXQN+7/29P6UcGq1kYalURq6
|
||||
S8SpeJ1ofp5rBEoD/TIkvU0JOcid65wp+fdzXGXsfiZvHraU74jSCgjP/wqfVGRy
|
||||
BIQzB0SIxSpnrsigqNsE1E94toDMx4wovjHu/9ABAImREV7Sz83OeFF00/sghrjT
|
||||
EJOD/gHf04JCn9MgNOqvSTysr9LXWg/oUKQDEYeTq9ux6pq/oqv1MxwONbSZPtN5
|
||||
yD41mi+hT8Rh+W8Je8rsiML4VMxzsb1l9303asw6suo5bLTISKNSbu1nt1NkpNxz
|
||||
ywIDAQAB
|
||||
-----END PUBLIC KEY-----
|
||||
",
|
||||
samlSPMetaDataXML => {
|
||||
"sp.com" => {
|
||||
samlSPMetaDataXML =>
|
||||
samlSPMetaDataXML( 'sp', 'HTTP-POST' )
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
sub sp {
|
||||
return LLNG::Manager::Test->new( {
|
||||
ini => {
|
||||
logLevel => $debug,
|
||||
timeout => $timeout,
|
||||
domain => 'sp.com',
|
||||
portal => 'http://auth.sp.com',
|
||||
authentication => 'SAML',
|
||||
userDB => 'Same',
|
||||
issuerDBSAMLActivation => 0,
|
||||
restSessionServer => 1,
|
||||
samlIDPMetaDataExportedAttributes => {
|
||||
idp => {
|
||||
mail => "0;mail;;",
|
||||
uid => "1;uid",
|
||||
cn => "0;cn"
|
||||
}
|
||||
},
|
||||
samlIDPMetaDataOptions => {
|
||||
idp => {
|
||||
samlIDPMetaDataOptionsEncryptionMode => 'none',
|
||||
samlIDPMetaDataOptionsSSOBinding => 'post',
|
||||
samlIDPMetaDataOptionsSLOBinding => 'post',
|
||||
samlIDPMetaDataOptionsSignSSOMessage => 1,
|
||||
samlIDPMetaDataOptionsSignSLOMessage => 1,
|
||||
samlIDPMetaDataOptionsCheckSSOMessageSignature => 1,
|
||||
samlIDPMetaDataOptionsCheckSLOMessageSignature => 1,
|
||||
samlIDPMetaDataOptionsForceUTF8 => 1,
|
||||
}
|
||||
},
|
||||
samlIDPMetaDataExportedAttributes => {
|
||||
idp => {
|
||||
"uid" => "0;uid;;",
|
||||
"cn" => "1;cn;;",
|
||||
},
|
||||
},
|
||||
samlIDPMetaDataXML => {
|
||||
idp => {
|
||||
samlIDPMetaDataXML =>
|
||||
samlIDPMetaDataXML( 'idp', 'HTTP-POST' )
|
||||
}
|
||||
},
|
||||
samlOrganizationDisplayName => "SP",
|
||||
samlOrganizationName => "SP",
|
||||
samlOrganizationURL => "http://www.sp.com",
|
||||
samlServicePublicKeySig => "-----BEGIN PUBLIC KEY-----
|
||||
MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAu4iToYAEmWQxgZDihGVz
|
||||
MMql1elPn37domWcvXeU2E4yt2hh5jkQHiFjgodfOlNeRIw5QJVlUBwr+CQvbaKR
|
||||
FXd7BrOhQIDC0TZPRVB0XHarUtsCuDekN4/2GKSzHsoToKUVPWq9thsuek3xkpsJ
|
||||
GZNX7bglfEc9+QQpYTqN1rkdN1PVU0epNMokFFGho5pLRqLUV5+I/QXAL49jfTja
|
||||
Sxsp4UndTI8/+mGSRSq+nrT2zyQRM/vkj5vR9ZVz67HO/+Wk3Mx6RAwkVcMdgMAq
|
||||
Cq8odmbI0yCRZiTL9ybKWRKqWJoKJ0p5+Q2fPEBPupQZR09Jt/JPuLVSsGfCxi9N
|
||||
qwIDAQAB
|
||||
-----END PUBLIC KEY-----
|
||||
",
|
||||
samlServicePrivateKeyEnc => "-----BE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Qhrfs
|
||||
I6RVUtwFdCyfl/jzBY9Gykkg03sMgW7Qw2SCCsSt05M+jDtBbNJ7esP6PAeKFvXZ
|
||||
ZWhdeiAa4kM/P6gtvZXQ4tY4LkSbcd6b0SzzFFsCgYBjMsusFzuBd95JyfZnMNye
|
||||
5gzzu0teKMWd0CLfqB7foQ81sH9lwCTpg8ZGtbDuMdrwz6ViDR9NceQBjhqXaAZ1
|
||||
f3rW79d+22Ms9wdcJLV4oSeSzzv2FSwLT8NvvqNeNc4YArshbnVDXKDEUrfhhueh
|
||||
Ay2ZK58clpkaDVYg2hckgQKBgG3KuhtSI/YE4fwXN9yez7A2XNGPZem/IGqWo9lu
|
||||
PGJCrXqT2IqPLW82gB083r6jo+CUhonTxqqb82tA7g4PUvqvQ5Dmnk1NMKYe255K
|
||||
gp3HUO8GF2EWFIak5Hcr6oOLuDi6cjh3/euTk7ld8fYsTD0mzEOjiQhWW1p5X6bT
|
||||
LLp/AoGAHvkxA1NM1HJ3myAREbwNXxRy/nhNt4mwMkZ6hPQsW/Eg/3r7j6MJOFrm
|
||||
U8AJJjDGKe6nlXhhnMoQfJzAc0cYNgjktmJXW27fHGIwt/2QwYNFHPK3s7HTrfH6
|
||||
7T4XKT3yGeeeyC2soKJQPlGB+ETdIUnXa7eo9KVWtMTgISyx1Qk=
|
||||
-----END RSA PRIVATE KEY-----
|
||||
",
|
||||
samlServicePrivateKeySig => "-----BEGIN RSA PRIVATE KEY-----
|
||||
MIIEpAIBAAKCAQEAu4iToYAEmWQxgZDihGVzMMql1elPn37domWcvXeU2E4yt2hh
|
||||
5jkQHiFjgodfOlNeRIw5QJVlUBwr+CQvbaKRFXd7BrOhQIDC0TZPRVB0XHarUtsC
|
||||
uDekN4/2GKSzHsoToKUVPWq9thsuek3xkpsJGZNX7bglfEc9+QQpYTqN1rkdN1PV
|
||||
U0epNMokFFGho5pLRqLUV5+I/QXAL49jfTjaSxsp4UndTI8/+mGSRSq+nrT2zyQR
|
||||
M/vkj5vR9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1liSv9BlF6WSfBb1zam09KGh1405Sq
|
||||
SxG9LlV8cFJE5TyWTdg/TNTyiaRvAt2JG+yAdkfrdOPXvCeE3yxRJ30+IP9evA4C
|
||||
O6p19sBxe7rYQFFjUAVjSIMh1E22yEqDZtGB8JV0chob8K5uHY4CdAPylu7jTA3o
|
||||
V1maAwKBgQCSGQ3yzsk4EGN2xd/JdgGDzhKyTZTQKMWYqQcsYxRAQ7Paj7u+Wkgv
|
||||
dBeKcI0HwgpLy5ZohSd2erqieIsW0pEbJWCmos4IcO8tgNfEOa5WXYdyLbj5tFwt
|
||||
ctu4/BJdijqfpMAtG8pv6k09gYjfASVytXmydGcs/0rVKYCRQA8Tow==
|
||||
-----END RSA PRIVATE KEY-----
|
||||
",
|
||||
samlServicePublicKeyEnc => "-----BEGIN PUBLIC KEY-----
|
||||
MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAsRaod2RZ8hMFBl+Vhsnh
|
||||
yPM8l/Fj1obnBxfQIaWuHFIFfXiGe/CYHuZ5QJQLnZxHMJX6LL3Sh+Usog3p0jpi
|
||||
jpcg0QgfBSEkfopKTgReYN8DiDIll0rV1XdTni7E85Nd1YyNy3ui/ZD+UShWwqu6
|
||||
jLVLR+QUm+/1LIKYb3OCBTvOlY7xHoP6NSU1+Mr+YzGBUacdO2vnNxe/PQhxIeP1
|
||||
zO0njuqGHkwEpy8rUWRZbbDn31TmKjqlhgtsz5HPhbRaYEExhyepKgBiNz+RyxtY
|
||||
XVhuG8OrWQDoS5gYHSjdw1CTJyixeJwyoqA9RGYguG5nh9zndi3LWAh7Z0lx+tIz
|
||||
+wIDAQAB
|
||||
-----END PUBLIC KEY-----
|
||||
",
|
||||
samlSPSSODescriptorAuthnRequestsSigned => 1,
|
||||
},
|
||||
}
|
||||
);
|
||||
}
|
|
@ -18,6 +18,7 @@ my $client = LLNG::Manager::Test->new( {
|
|||
requireToken => 0,
|
||||
securedCookie => 2,
|
||||
https => 0,
|
||||
singleSession => 1,
|
||||
}
|
||||
}
|
||||
);
|
||||
|
|
|
@ -18,6 +18,7 @@ my $client = LLNG::Manager::Test->new( {
|
|||
requireToken => 0,
|
||||
securedCookie => 3,
|
||||
https => 0,
|
||||
singleSession => 1,
|
||||
}
|
||||
}
|
||||
);
|
||||
|
|
Loading…
Reference in New Issue