atlas-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ni...@apache.org
Subject [2/2] incubator-atlas git commit: ATLAS-1752:- Fix for Atlas group for kerberos authentication
Date Wed, 26 Apr 2017 07:42:17 GMT
ATLAS-1752:- Fix for Atlas group for kerberos authentication


Project: http://git-wip-us.apache.org/repos/asf/incubator-atlas/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-atlas/commit/77faaad6
Tree: http://git-wip-us.apache.org/repos/asf/incubator-atlas/tree/77faaad6
Diff: http://git-wip-us.apache.org/repos/asf/incubator-atlas/diff/77faaad6

Branch: refs/heads/0.8-incubating
Commit: 77faaad64e797a1d34c84957f24a21641dfe58f9
Parents: 4f040f5
Author: nixonrodrigues <nixon@apache.org>
Authored: Tue Apr 25 18:58:29 2017 +0530
Committer: nixonrodrigues <nixon@apache.org>
Committed: Wed Apr 26 13:09:28 2017 +0530

----------------------------------------------------------------------
 .../apache/atlas/web/filters/AtlasAuthenticationFilter.java  | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/77faaad6/webapp/src/main/java/org/apache/atlas/web/filters/AtlasAuthenticationFilter.java
----------------------------------------------------------------------
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 a643d62..473c78d 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
@@ -22,6 +22,7 @@ import org.apache.atlas.ApplicationProperties;
 import org.apache.atlas.RequestContext;
 import org.apache.atlas.security.SecurityProperties;
 import org.apache.atlas.utils.AuthenticationUtil;
+import org.apache.atlas.web.security.AtlasAuthenticationProvider;
 import org.apache.atlas.web.util.Servlets;
 import org.apache.commons.collections.iterators.IteratorEnumeration;
 import org.apache.commons.configuration.Configuration;
@@ -266,13 +267,8 @@ public class AtlasAuthenticationFilter extends AuthenticationFilter {
                     }
 
                     if ((existingAuth == null || !existingAuth.isAuthenticated()) &&
(!StringUtils.isEmpty(userName))) {
-                        UserGroupInformation ugi = UserGroupInformation.getLoginUser();
-                        String[] groupsName = ugi.getGroupNames();
 
-                        final List<GrantedAuthority> grantedAuths = new ArrayList<>();
-                        for (String group : groupsName) {
-                            grantedAuths.add(new SimpleGrantedAuthority(group));
-                        }
+                        List<GrantedAuthority> grantedAuths = AtlasAuthenticationProvider.getAuthoritiesFromUGI(userName);
 
                         final UserDetails principal = new User(userName, "", grantedAuths);
                         final Authentication finalAuthentication = new UsernamePasswordAuthenticationToken(principal,
"", grantedAuths);


Mime
View raw message