Commit 3492ec60 authored by Yadd's avatar Yadd
Browse files

Add utf8 test is SAML (#1118)

parent 1f06d872
...@@ -7,7 +7,7 @@ BEGIN { ...@@ -7,7 +7,7 @@ BEGIN {
require 't/test-lib.pm'; require 't/test-lib.pm';
} }
my $maintests = 16; my $maintests = 19;
my $debug = 'error'; my $debug = 'error';
my ( $issuer, $sp, $res ); my ( $issuer, $sp, $res );
my %handlerOR = ( issuer => [], sp => [] ); my %handlerOR = ( issuer => [], sp => [] );
...@@ -31,8 +31,8 @@ SKIP: { ...@@ -31,8 +31,8 @@ SKIP: {
ok( ok(
$res = $issuer->_post( $res = $issuer->_post(
'/', '/',
IO::String->new('user=dwho&password=dwho'), IO::String->new('user=russian&password=russian'),
length => 23 length => 29
), ),
'Auth query' 'Auth query'
); );
...@@ -71,7 +71,15 @@ SKIP: { ...@@ -71,7 +71,15 @@ SKIP: {
ok( $res = $sp->_get( '/', cookie => "lemonldap=$spId" ), 'Get / on SP' ); ok( $res = $sp->_get( '/', cookie => "lemonldap=$spId" ), 'Get / on SP' );
expectOK($res); expectOK($res);
expectAuthenticatedAs( $res, 'dwho@badwolf.org@idp' ); 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' );
# Logout initiated by IdP # Logout initiated by IdP
switch ('issuer'); switch ('issuer');
...@@ -498,6 +506,7 @@ sub sp { ...@@ -498,6 +506,7 @@ sub sp {
authentication => 'SAML', authentication => 'SAML',
userDB => 'Same', userDB => 'Same',
issuerDBSAMLActivation => 0, issuerDBSAMLActivation => 0,
restSessionServer => 1,
samlIDPMetaDataExportedAttributes => { samlIDPMetaDataExportedAttributes => {
idp => { idp => {
mail => "0;mail;;", mail => "0;mail;;",
...@@ -514,9 +523,16 @@ sub sp { ...@@ -514,9 +523,16 @@ sub sp {
samlIDPMetaDataOptionsSignSLOMessage => 1, samlIDPMetaDataOptionsSignSLOMessage => 1,
samlIDPMetaDataOptionsCheckSSOMessageSignature => 1, samlIDPMetaDataOptionsCheckSSOMessageSignature => 1,
samlIDPMetaDataOptionsCheckSLOMessageSignature => 1, samlIDPMetaDataOptionsCheckSLOMessageSignature => 1,
samlIDPMetaDataOptionsForceUTF8 => 1,
samlIDPMetaDataOptionsAllowLoginFromIDP => 1, samlIDPMetaDataOptionsAllowLoginFromIDP => 1,
} }
}, },
samlIDPMetaDataExportedAttributes => {
idp => {
"uid" => "0;uid;;",
"cn" => "1;cn;;",
},
},
samlIDPMetaDataXML => { samlIDPMetaDataXML => {
idp => { idp => {
samlIDPMetaDataXML => <<EOF samlIDPMetaDataXML => <<EOF
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment