Merged HEAD-BUG-FIX (5.0/Cloud) to HEAD (5.0/Cloud)

77207: Merged PLATFORM1 (5.0/Cloud) to HEAD-BUG-FIX (5.0/Cloud)
      75127: Test a fix for oauth breakage in Cloud build


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@78063 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Mark Rogers
2014-07-23 16:31:26 +00:00
parent e0cd637688
commit 8b87bbf09a

View File

@@ -38,7 +38,10 @@ public class PublicApiAuthenticatorFactory extends BasicHttpAuthenticatorFactory
private static Log logger = LogFactory.getLog(PublicApiAuthenticatorFactory.class); private static Log logger = LogFactory.getLog(PublicApiAuthenticatorFactory.class);
public static final String DEFAULT_AUTHENTICATOR_KEY_HEADER = "X-Alfresco-Authenticator-Key"; public static final String DEFAULT_AUTHENTICATOR_KEY_HEADER = "X-Alfresco-Authenticator-Key";
public static final String DEFAULT_REMOTE_USER_HEADER = "X-Alfresco-Remote-User";
private String remoteUserHeader = DEFAULT_REMOTE_USER_HEADER;
private String authenticatorKeyHeader = DEFAULT_AUTHENTICATOR_KEY_HEADER; private String authenticatorKeyHeader = DEFAULT_AUTHENTICATOR_KEY_HEADER;
private RemoteUserMapper remoteUserMapper; private RemoteUserMapper remoteUserMapper;
private RetryingTransactionHelper retryingTransactionHelper; private RetryingTransactionHelper retryingTransactionHelper;
@@ -170,6 +173,12 @@ public class PublicApiAuthenticatorFactory extends BasicHttpAuthenticatorFactory
{ {
userId = remoteUserMapper.getRemoteUser(this.servletReq.getHttpServletRequest()); userId = remoteUserMapper.getRemoteUser(this.servletReq.getHttpServletRequest());
} }
else
{
// fall back to extracting the header
userId = servletReq.getHeader(remoteUserHeader);
}
if (logger.isDebugEnabled()) if (logger.isDebugEnabled())
{ {
if (userId == null) if (userId == null)