-
Notifications
You must be signed in to change notification settings - Fork 270
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes #2346 This changes the serviceURL sent by SOGo to the CAS server: /SOGo/so/ -> /SOGo/so/index
- Loading branch information
Jean Raby
committed
Jun 20, 2013
1 parent
d284825
commit 41ed498
Showing
7 changed files
with
118 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,6 +20,7 @@ | |
* Boston, MA 02111-1307, USA. | ||
*/ | ||
|
||
#import <Foundation/NSBundle.h> | ||
#import <Foundation/NSDictionary.h> | ||
#import <Foundation/NSURL.h> | ||
|
||
|
@@ -35,6 +36,11 @@ | |
#import <NGObjWeb/WOResponse.h> | ||
#import <NGExtensions/NSObject+Logs.h> | ||
|
||
#import <SaxObjC/SaxObjC.h> | ||
#import <SaxObjC/SaxMethodCallHandler.h> | ||
#import <SaxObjC/SaxObjectDecoder.h> | ||
#import <SaxObjC/SaxXMLReaderFactory.h> | ||
|
||
#import "NSDictionary+Utilities.h" | ||
#import "NSString+Utilities.h" | ||
#import "SOGoCache.h" | ||
|
@@ -106,6 +112,43 @@ + (SOGoCASSession *) CASSessionWithIdentifier: (NSString *) newIdentifier | |
return session; | ||
} | ||
|
||
+ (void) handleLogoutRequest: (NSString *) logoutRequest | ||
{ | ||
CASLogoutRequest *rq; | ||
SOGoCache *cache; | ||
NSBundle *bundle; | ||
NSDictionary *root; | ||
NSString *mapFile, *sessionIndex; | ||
|
||
bundle = [NSBundle bundleForClass: [self class]]; | ||
mapFile = [bundle pathForResource: @"CASLogoutRequestMap" ofType: @"plist"]; | ||
if (![mapFile length]) | ||
{ | ||
[self errorWithFormat: @"mapFile not found (CASLogoutRequest.plist)"]; | ||
return; | ||
} | ||
|
||
id<NSObject,SaxXMLReader> parser = nil; | ||
SaxObjectDecoder *sax = nil; | ||
parser = [[SaxXMLReaderFactory standardXMLReaderFactory] | ||
createXMLReaderForMimeType:@"text/xml"]; | ||
|
||
sax = [[SaxObjectDecoder alloc] initWithMappingAtPath: mapFile]; | ||
[sax autorelease]; | ||
[parser setContentHandler:sax]; | ||
[parser setErrorHandler:sax]; | ||
[parser parseFromSource: logoutRequest]; | ||
|
||
rq = [sax rootObject]; | ||
sessionIndex = [rq sessionIndex]; | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
jraby
Contributor
|
||
|
||
if ([sessionIndex length]) | ||
{ | ||
cache = [SOGoCache sharedCache]; | ||
This comment has been minimized.
Sorry, something went wrong.
extrafu
Contributor
|
||
[cache removeCASSessionWithTicket: sessionIndex]; | ||
} | ||
} | ||
|
||
- (id) init | ||
{ | ||
if ((self = [super init])) | ||
|
@@ -381,7 +424,12 @@ - (void) _fetchTicketData | |
NSString *serviceURL; | ||
|
||
soURL = [[WOApplication application] soURL]; | ||
serviceURL = [soURL absoluteString]; | ||
|
||
/* appending 'index' to /SOGo/so/ so that callbacks made by the CAS server | ||
* are not greeted with a 302 generated by sope. The CAS server doesn't | ||
* follow redirects, and we'd end up losing the LogoutRequests | ||
*/ | ||
serviceURL = [NSString stringWithFormat: @"%@index", [soURL absoluteString]]; | ||
|
||
params = [NSDictionary dictionaryWithObjectsAndKeys: | ||
ticket, @"ticket", serviceURL, @"service", | ||
|
@@ -466,3 +514,28 @@ - (void) invalidateTicketForService: (NSString *) service | |
} | ||
|
||
@end | ||
|
||
@implementation CASLogoutRequest | ||
|
||
- (id) init | ||
{ | ||
if ((self = [super init])) | ||
{ | ||
sessionIndex = nil; | ||
} | ||
|
||
return self; | ||
} | ||
|
||
- (void) dealloc | ||
{ | ||
[sessionIndex release]; | ||
[super dealloc]; | ||
} | ||
|
||
- (NSString *) sessionIndex | ||
{ | ||
return sessionIndex; | ||
} | ||
|
||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Shouldn't you retain it?