Commit 1ee2c1bc by Shwetha GS

ATLAS-995 Atlas to setup ldap authentication type as either LDAP / AD or None…

ATLAS-995 Atlas to setup ldap authentication type as either LDAP / AD or None (nixonrodrigues via shwethags)
parent 7fc276f6
...@@ -92,11 +92,10 @@ atlas.enableTLS=false ...@@ -92,11 +92,10 @@ atlas.enableTLS=false
# Authentication config # Authentication config
atlas.authentication.method.kerberos=false atlas.authentication.method.kerberos=false
atlas.authentication.method.ldap=false
atlas.authentication.method.file=true atlas.authentication.method.file=true
#### ldap.type= LDAP or AD #### ldap.type= LDAP or AD
atlas.authentication.method.ldap.type=LDAP atlas.authentication.method.ldap.type=none
#### user credentials file #### user credentials file
atlas.authentication.method.file.filename=${sys:atlas.home}/conf/users-credentials.properties atlas.authentication.method.file.filename=${sys:atlas.home}/conf/users-credentials.properties
......
...@@ -6,6 +6,7 @@ INCOMPATIBLE CHANGES: ...@@ -6,6 +6,7 @@ INCOMPATIBLE CHANGES:
ALL CHANGES: ALL CHANGES:
ATLAS-995 Atlas to setup ldap authentication type as either LDAP / AD or None (nixonrodrigues via shwethags)
ATLAS-902 Atlas throws exception due to null definition in Hive create table statement (svimal2106 via shwethags) ATLAS-902 Atlas throws exception due to null definition in Hive create table statement (svimal2106 via shwethags)
ATLAS-987 Atlas hooks should avoid adding dependent libraries to component CLASSPATH (madhan.neethiraj via shwethags) ATLAS-987 Atlas hooks should avoid adding dependent libraries to component CLASSPATH (madhan.neethiraj via shwethags)
ATLAS-993 If condition in DSL order by clause is not defined then dsl query fails (guptaneeru via shwethags) ATLAS-993 If condition in DSL order by clause is not defined then dsl query fails (guptaneeru via shwethags)
......
...@@ -35,10 +35,8 @@ public class AtlasAuthenticationProvider extends ...@@ -35,10 +35,8 @@ public class AtlasAuthenticationProvider extends
.getLogger(AtlasAuthenticationProvider.class); .getLogger(AtlasAuthenticationProvider.class);
private boolean fileAuthenticationMethodEnabled = true; private boolean fileAuthenticationMethodEnabled = true;
private boolean ldapAuthenticationMethodEnabled = false; private String ldapType = "NONE";
private String ldapType = "UNKNOWN";
public static final String FILE_AUTH_METHOD = "atlas.authentication.method.file"; public static final String FILE_AUTH_METHOD = "atlas.authentication.method.file";
public static final String LDAP_AUTH_METHOD = "atlas.authentication.method.ldap";
public static final String LDAP_TYPE = "atlas.authentication.method.ldap.type"; public static final String LDAP_TYPE = "atlas.authentication.method.ldap.type";
@Autowired @Autowired
...@@ -57,9 +55,7 @@ public class AtlasAuthenticationProvider extends ...@@ -57,9 +55,7 @@ public class AtlasAuthenticationProvider extends
this.fileAuthenticationMethodEnabled = configuration.getBoolean( this.fileAuthenticationMethodEnabled = configuration.getBoolean(
FILE_AUTH_METHOD, true); FILE_AUTH_METHOD, true);
this.ldapAuthenticationMethodEnabled = configuration.getBoolean( this.ldapType = configuration.getString(LDAP_TYPE, "NONE");
LDAP_AUTH_METHOD, false);
this.ldapType = configuration.getString(LDAP_TYPE, "UNKNOWN");
} catch (Exception e) { } catch (Exception e) {
LOG.error( LOG.error(
"Error while getting atlas.login.method application properties", "Error while getting atlas.login.method application properties",
...@@ -71,22 +67,19 @@ public class AtlasAuthenticationProvider extends ...@@ -71,22 +67,19 @@ public class AtlasAuthenticationProvider extends
public Authentication authenticate(Authentication authentication) public Authentication authenticate(Authentication authentication)
throws AuthenticationException { throws AuthenticationException {
if (ldapAuthenticationMethodEnabled) { if (ldapType.equalsIgnoreCase("LDAP")) {
try {
if (ldapType.equalsIgnoreCase("LDAP")) { authentication = ldapAuthenticationProvider
try { .authenticate(authentication);
authentication = ldapAuthenticationProvider } catch (Exception ex) {
.authenticate(authentication); LOG.error("Error while LDAP authentication", ex);
} catch (Exception ex) { }
LOG.error("Error while LDAP authentication", ex); } else if (ldapType.equalsIgnoreCase("AD")) {
} try {
} else if (ldapType.equalsIgnoreCase("AD")) { authentication = adAuthenticationProvider
try { .authenticate(authentication);
authentication = adAuthenticationProvider } catch (Exception ex) {
.authenticate(authentication); LOG.error("Error while AD authentication", ex);
} catch (Exception ex) {
LOG.error("Error while AD authentication", ex);
}
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment