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:
Jean Raby
2013-06-20 14:32:14 -04:00
parent d28482557f
commit 41ed498d65
7 changed files with 118 additions and 4 deletions
+17 -2
View File
@@ -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;