This is an automated email from the ASF dual-hosted git repository.
nixon pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/atlas.git
The following commit(s) were added to refs/heads/master by this push:
new ebeb0c9 ATLAS-3243 : Fix to support Atlas UI to be access via Knox
Trusted Proxy.
ebeb0c9 is described below
commit ebeb0c9882b844c71382f2a1193dbf0e10c876db
Author: nixonrodrigues <[email protected]>
AuthorDate: Wed May 29 18:12:34 2019 +0530
ATLAS-3243 : Fix to support Atlas UI to be access via Knox Trusted Proxy.
Change-Id: I1612c402729c50145b8c7f8f5a57f959b0bd4ba2
---
.../org/apache/atlas/web/filters/AtlasAuthenticationFilter.java | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git
a/webapp/src/main/java/org/apache/atlas/web/filters/AtlasAuthenticationFilter.java
b/webapp/src/main/java/org/apache/atlas/web/filters/AtlasAuthenticationFilter.java
index 782b5a0..f56aeb4 100644
---
a/webapp/src/main/java/org/apache/atlas/web/filters/AtlasAuthenticationFilter.java
+++
b/webapp/src/main/java/org/apache/atlas/web/filters/AtlasAuthenticationFilter.java
@@ -389,6 +389,7 @@ public class AtlasAuthenticationFilter extends
AuthenticationFilter {
HttpServletResponse httpResponse =
(HttpServletResponse) response;
boolean isHttps =
"https".equals(httpRequest.getScheme());
AuthenticationHandler authHandler =
getAuthenticationHandler();
+ String doAsUser = supportTrustedProxy ?
Servlets.getDoAsUser(httpRequest) : null;
try {
boolean newToken = false;
@@ -445,7 +446,6 @@ public class AtlasAuthenticationFilter extends
AuthenticationFilter {
};
// Create the proxy user if doAsUser exists
- String doAsUser = supportTrustedProxy ?
Servlets.getDoAsUser(httpRequest) : null;
if (supportTrustedProxy && doAsUser != null &&
!doAsUser.equals(httpRequest.getRemoteUser())) {
LOG.debug("doAsUser is {}", doAsUser);
@@ -507,8 +507,10 @@ public class AtlasAuthenticationFilter extends
AuthenticationFilter {
errCode = HttpServletResponse.SC_FORBIDDEN;
}
+ boolean isKerberosOnBrowser = supportKeyTabBrowserLogin ||
doAsUser != null;
+
if (authenticationEx == null) { // added this code for atlas
error handling and fallback
- if (!supportKeyTabBrowserLogin &&
isBrowser(httpRequest.getHeader("User-Agent"))) {
+ if (!isKerberosOnBrowser &&
isBrowser(httpRequest.getHeader("User-Agent"))) {
filterChain.doFilter(request, response);
} else {
boolean chk = true;