From 3f3673cf5ad2691c04f975dc58a58173e7c6c2ee Mon Sep 17 00:00:00 2001 From: Ludovic Marcotte Date: Thu, 4 Dec 2014 17:59:17 -0500 Subject: [PATCH] Added SOGoSAML2LogoutURL --- Documentation/SOGoInstallationGuide.asciidoc | 5 +++++ SoObjects/SOGo/SOGoSystemDefaults.h | 1 + SoObjects/SOGo/SOGoSystemDefaults.m | 5 +++++ UI/MainUI/SOGoSAML2Actions.m | 9 +++++++++ 4 files changed, 20 insertions(+) diff --git a/Documentation/SOGoInstallationGuide.asciidoc b/Documentation/SOGoInstallationGuide.asciidoc index b28e512a4..7b332cf26 100644 --- a/Documentation/SOGoInstallationGuide.asciidoc +++ b/Documentation/SOGoInstallationGuide.asciidoc @@ -457,6 +457,11 @@ SAML2 as authentication mechanism. When using this feature, SOGo will invoke the IdP to proceed with the logout procedure. When the user clicks on the logout button, a redirection will be made to the IdP to trigger the logout. +|S |SOGoSAML2LogoutURL +|The URL to which redirect the user after the "Logout" link is clicked. +SOGoSAML2LogoutEnabled must be set to YES. If unset, the user will be +redirected to a blank page. + |D |SOGoTimeZone |Parameter used to set a default time zone for users. The default timezone is set to UTC. The Olson database is a standard database that diff --git a/SoObjects/SOGo/SOGoSystemDefaults.h b/SoObjects/SOGo/SOGoSystemDefaults.h index 4d68d7538..de5a140fa 100644 --- a/SoObjects/SOGo/SOGoSystemDefaults.h +++ b/SoObjects/SOGo/SOGoSystemDefaults.h @@ -82,6 +82,7 @@ - (NSString *) SAML2IdpCertificateLocation; - (NSString *) SAML2LoginAttribute; - (BOOL) SAML2LogoutEnabled; +- (NSString *) SAML2LogoutURL; - (BOOL) enablePublicAccess; diff --git a/SoObjects/SOGo/SOGoSystemDefaults.m b/SoObjects/SOGo/SOGoSystemDefaults.m index d48ab7c03..f9aa5fcc2 100644 --- a/SoObjects/SOGo/SOGoSystemDefaults.m +++ b/SoObjects/SOGo/SOGoSystemDefaults.m @@ -511,6 +511,11 @@ _injectConfigurationFromFile (NSMutableDictionary *defaultsDict, return [self boolForKey: @"SOGoSAML2LogoutEnabled"]; } +- (NSString *) SAML2LogoutURL +{ + return [self stringForKey: @"SOGoSAML2LogoutURL"]; +} + - (NSString *) SAML2LoginAttribute { return [self stringForKey: @"SOGoSAML2LoginAttribute"]; diff --git a/UI/MainUI/SOGoSAML2Actions.m b/UI/MainUI/SOGoSAML2Actions.m index 4a92221bf..09bc3d060 100644 --- a/UI/MainUI/SOGoSAML2Actions.m +++ b/UI/MainUI/SOGoSAML2Actions.m @@ -73,6 +73,7 @@ { NSString *userName, *value, *cookieName, *domain, *username, *password; SOGoWebAuthenticator *auth; + SOGoSystemDefaults *sd; WOResponse *response; NSCalendarDate *date; WOCookie *cookie; @@ -81,8 +82,16 @@ userName = [[context activeUser] login]; [self logWithFormat: @"SAML2 IdP-initiated SLO for user '%@'", userName]; + sd = [SOGoSystemDefaults sharedSystemDefaults]; + response = [context response]; + if ([sd SAML2LogoutURL]) + { + [response setStatus: 302]; + [response setHeader: [sd SAML2LogoutURL] forKey: @"location"]; + } + if ([userName isEqualToString: @"anonymous"]) return response;