--- SOGo-1.3.9/SoObjects/SOGo/SOGoProxyAuthenticator.m.orig	2011-10-29 22:31:30.000000000 +0400
+++ SOGo-1.3.9/SoObjects/SOGo/SOGoProxyAuthenticator.m	2011-11-18 15:37:17.000000000 +0400
@@ -32,6 +32,7 @@
 #import <NGExtensions/NSObject+Logs.h>
 
 #import "SOGoPermissions.h"
+#import "SOGoSystemDefaults.h"
 #import "SOGoUser.h"
 
 #import "SOGoProxyAuthenticator.h"
@@ -59,10 +60,21 @@
 - (NSString *) checkCredentialsInContext: (WOContext *) context
 {
   NSString *remoteUser;
+  NSString *authSecret;
+  SOGoSystemDefaults *sd;
 
-  /* If such a header is not provided by the proxy, SOPE will attempt to
-     deduce it from the "Authorization" header. */
-  remoteUser = [[context request] headerForKey: @"x-webobjects-remote-user"];
+  sd = [SOGoSystemDefaults sharedSystemDefaults];
+  authSecret = [[context request] headerForKey: @"x-webobjects-auth-secret"];
+  remoteUser = nil;
+
+  if ([[sd authenticationType] isEqualToString: authSecret])
+    {
+    /* If such a header is not provided by the proxy, SOPE will attempt to
+       deduce it from the "Authorization" header. */
+    remoteUser = [[context request] headerForKey: @"x-webobjects-remote-user"];
+    }
+  else
+    [self errorWithFormat: @"invalid x-webobjects-auth-secret value"];
 
   return remoteUser;
 }
