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
# Authentication config
atlas.authentication.method.kerberos=false
atlas.authentication.method.ldap=false
atlas.authentication.method.file=true
#### ldap.type= LDAP or AD
atlas.authentication.method.ldap.type=LDAP
atlas.authentication.method.ldap.type=none
#### user credentials file
atlas.authentication.method.file.filename=${sys:atlas.home}/conf/users-credentials.properties
......
......@@ -6,6 +6,7 @@ INCOMPATIBLE 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-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)
......
......@@ -35,10 +35,8 @@ public class AtlasAuthenticationProvider extends
.getLogger(AtlasAuthenticationProvider.class);
private boolean fileAuthenticationMethodEnabled = true;
private boolean ldapAuthenticationMethodEnabled = false;
private String ldapType = "UNKNOWN";
private String ldapType = "NONE";
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";
@Autowired
......@@ -57,9 +55,7 @@ public class AtlasAuthenticationProvider extends
this.fileAuthenticationMethodEnabled = configuration.getBoolean(
FILE_AUTH_METHOD, true);
this.ldapAuthenticationMethodEnabled = configuration.getBoolean(
LDAP_AUTH_METHOD, false);
this.ldapType = configuration.getString(LDAP_TYPE, "UNKNOWN");
this.ldapType = configuration.getString(LDAP_TYPE, "NONE");
} catch (Exception e) {
LOG.error(
"Error while getting atlas.login.method application properties",
......@@ -71,22 +67,19 @@ public class AtlasAuthenticationProvider extends
public Authentication authenticate(Authentication authentication)
throws AuthenticationException {
if (ldapAuthenticationMethodEnabled) {
if (ldapType.equalsIgnoreCase("LDAP")) {
try {
authentication = ldapAuthenticationProvider
.authenticate(authentication);
} catch (Exception ex) {
LOG.error("Error while LDAP authentication", ex);
}
} else if (ldapType.equalsIgnoreCase("AD")) {
try {
authentication = adAuthenticationProvider
.authenticate(authentication);
} catch (Exception ex) {
LOG.error("Error while AD authentication", ex);
}
if (ldapType.equalsIgnoreCase("LDAP")) {
try {
authentication = ldapAuthenticationProvider
.authenticate(authentication);
} catch (Exception ex) {
LOG.error("Error while LDAP authentication", ex);
}
} else if (ldapType.equalsIgnoreCase("AD")) {
try {
authentication = adAuthenticationProvider
.authenticate(authentication);
} 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