Commit cf12cccd authored by Xavier Guimard's avatar Xavier Guimard

Backport #994 fix

parent 014c5d5d
......@@ -11,7 +11,7 @@ describe('Lemonldap::NG', function() {
browser.driver.get('http://test1.example.com:' + process.env.TESTWEBSERVERPORT + '/');
expect(browser.getCurrentUrl()).toMatch(new RegExp('^http://auth.example.com(:' + process.env.TESTWEBSERVERPORT + ')?/\\?url=aHR0cDovL3Rlc3QxLmV4YW1wbGUuY29tOjE5ODc2Lw=='));
});
it('should accept authentication as dwho/dwho', function() {
it('should accept authentication as dwho/dwho', function() {
browser.driver.findElement(by.xpath("//input[@name='user']")).sendKeys('dwho');
browser.driver.findElement(by.xpath("//input[@name='password']")).sendKeys('dwho');
browser.driver.findElement(by.xpath("//button[@type='submit']")).click();
......@@ -20,4 +20,4 @@ describe('Lemonldap::NG', function() {
expect(browser.getCurrentUrl()).toMatch(new RegExp('^http://test1.example.com(:' + process.env.TESTWEBSERVERPORT + ')?'));
});
});
});
\ No newline at end of file
});
'use strict';
describe('Lemonldap::NG', function() {
describe('Logout_app', function() {
it('should accept authentication as dwho/dwho', function() {
browser.driver.get('http://auth.example.com:' + process.env.TESTWEBSERVERPORT + '/');
browser.driver.findElement(by.xpath("//input[@name='user']")).sendKeys('dwho');
browser.driver.findElement(by.xpath("//input[@name='password']")).sendKeys('dwho');
browser.driver.findElement(by.xpath("//button[@type='submit']")).click();
});
it('should allow logout_app', function() {
browser.driver.get('http://test1.example.com:' + process.env.TESTWEBSERVERPORT + '/index.pl?logout_app');
});
it('should keep session', function() {
expect(browser.getCurrentUrl()).toMatch(new RegExp('^http://test1.example.com(:' + process.env.TESTWEBSERVERPORT + ')?/index.pl\\?foo=1'));
});
});
});
'use strict';
describe('Lemonldap::NG', function() {
describe('Logout_app', function() {
it('should allow logout_app_sso', function() {
browser.driver.get('http://test1.example.com:' + process.env.TESTWEBSERVERPORT + '/index.pl?logout_all');
});
it('should redirect after logout', function() {
expect(browser.getCurrentUrl()).toMatch(new RegExp('^http://lemonldap-ng\.org/welcome'));
});
it('should redirect to portal', function() {
browser.driver.get('http://test1.example.com:' + process.env.TESTWEBSERVERPORT + '/');
expect(browser.getCurrentUrl()).toMatch(new RegExp('^http://auth.example.com(:' + process.env.TESTWEBSERVERPORT + ')?/\\?url=aHR0cDovL3Rlc3QxLmV4YW1wbGUuY29tOjE5ODc2Lw=='));
});
});
});
......@@ -136,6 +136,8 @@
},
"test1.example.com": {
"^/logout": "logout_sso",
"^/index.pl\\?logout_app$": "logout_app http://test1.example.com:__port__/index.pl?foo=1",
"^/index.pl\\?logout_all$": "logout_app_sso http://lemonldap-ng.org/welcome/",
"default": "accept"
},
"test2.example.com": {
......@@ -183,4 +185,4 @@
"timeout": 72000,
"userDB": "Demo",
"whatToTrace": "_whatToTrace"
}
\ No newline at end of file
}
......@@ -463,8 +463,8 @@ sub conditionSub {
);
}
elsif ( $cond =~ /^logout_app_sso(?:\s+(.*))?$/i ) {
eval 'use Apache2::Filter' unless ( $INC{"Apache2/Filter.pm"} );
my $u = $1 || &{ $class->tsv->{portal} }();
eval 'use Apache2::Filter' unless ( $INC{"Apache2/Filter.pm"} );
return (
sub {
......@@ -475,7 +475,7 @@ sub conditionSub {
my $r = $_[0]->r;
return $class->redirectFilter(
&{ $class->tsv->{portal} }() . "?url="
. $class->encodeUrl( $r, $u )
. $class->encodeUrl($u)
. "&logout=1",
@_
);
......
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