mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-07-05 08:34:30 +00:00
Add support for CAS LogoutRequests
Fixes #2346 This changes the serviceURL sent by SOGo to the CAS server: /SOGo/so/ -> /SOGo/so/index
This commit is contained in:
@@ -272,10 +272,13 @@
|
||||
{
|
||||
NSDictionary *redirectKeys;
|
||||
NSURL *soURL;
|
||||
NSString *serviceURL;
|
||||
|
||||
soURL = [[WOApplication application] soURL];
|
||||
// appending 'index' to /SOGo/so/. Matches serviceURL sent by _pgtUrlFromURL
|
||||
serviceURL = [NSString stringWithFormat: @"%@index", [soURL absoluteString]];
|
||||
|
||||
redirectKeys = [NSDictionary dictionaryWithObject: [soURL absoluteString]
|
||||
redirectKeys = [NSDictionary dictionaryWithObject: serviceURL
|
||||
forKey: @"service"];
|
||||
|
||||
return redirectKeys;
|
||||
@@ -302,7 +305,7 @@
|
||||
- (id <WOActionResults>) _casDefaultAction
|
||||
{
|
||||
WOResponse *response;
|
||||
NSString *login, *newLocation, *oldLocation, *ticket;
|
||||
NSString *login, *logoutRequest, *newLocation, *oldLocation, *ticket;
|
||||
SOGoCASSession *casSession;
|
||||
SOGoWebAuthenticator *auth;
|
||||
WOCookie *casCookie, *casLocationCookie;
|
||||
@@ -340,6 +343,18 @@
|
||||
withName: @"cas-location"];
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
/* anonymous and no ticket, possibly a logout request from CAS
|
||||
* See: https://wiki.jasig.org/display/CASUM/Single+Sign+Out
|
||||
*/
|
||||
logoutRequest = [rq formValueForKey: @"logoutRequest"];
|
||||
if ([logoutRequest length])
|
||||
{
|
||||
[SOGoCASSession handleLogoutRequest: logoutRequest];
|
||||
return [self responseWithStatus: 200];
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
ticket = nil;
|
||||
|
||||
Reference in New Issue
Block a user