You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ranger.apache.org by ve...@apache.org on 2016/06/20 13:02:47 UTC
incubator-ranger git commit: Revert "RANGER-1023 : fixed the redirect
issue on initial home page from browser"
Repository: incubator-ranger
Updated Branches:
refs/heads/master 8d353cb44 -> 9b791db6d
Revert "RANGER-1023 : fixed the redirect issue on initial home page from browser"
This reverts commit ccbc468cd1a568b18a2331b98986a074683a1b1b.
Project: http://git-wip-us.apache.org/repos/asf/incubator-ranger/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ranger/commit/9b791db6
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ranger/tree/9b791db6
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ranger/diff/9b791db6
Branch: refs/heads/master
Commit: 9b791db6d05d521fcd89cec67fe90f5e01fa7aa5
Parents: 8d353cb
Author: Velmurugan Periasamy <ve...@apache.org>
Authored: Mon Jun 20 09:02:30 2016 -0400
Committer: Velmurugan Periasamy <ve...@apache.org>
Committed: Mon Jun 20 09:02:30 2016 -0400
----------------------------------------------------------------------
.../ranger/security/web/filter/RangerKrbFilter.java | 16 +++++++++++++++-
1 file changed, 15 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/9b791db6/security-admin/src/main/java/org/apache/ranger/security/web/filter/RangerKrbFilter.java
----------------------------------------------------------------------
diff --git a/security-admin/src/main/java/org/apache/ranger/security/web/filter/RangerKrbFilter.java b/security-admin/src/main/java/org/apache/ranger/security/web/filter/RangerKrbFilter.java
index c7694a1..120f098 100644
--- a/security-admin/src/main/java/org/apache/ranger/security/web/filter/RangerKrbFilter.java
+++ b/security-admin/src/main/java/org/apache/ranger/security/web/filter/RangerKrbFilter.java
@@ -498,7 +498,21 @@ public class RangerKrbFilter implements Filter {
errCode = HttpServletResponse.SC_FORBIDDEN;
}
if (authenticationEx == null) {
- filterChain.doFilter(request, response);
+ boolean chk = true;
+ Collection<String> headerNames = httpResponse.getHeaderNames();
+ for(String headerName : headerNames){
+ String value = httpResponse.getHeader(headerName);
+ if(headerName.equalsIgnoreCase("Set-Cookie") && value.startsWith("RANGERADMINSESSIONID")){
+ chk = false;
+ break;
+ }
+ }
+ String authHeader = httpRequest.getHeader("Authorization");
+ if(authHeader == null && chk){
+ filterChain.doFilter(request, response);
+ }else if(authHeader != null && authHeader.startsWith("Basic")){
+ filterChain.doFilter(request, response);
+ }
} else {
httpResponse.sendError(errCode, authenticationEx.getMessage());
}