add jaas config

This commit is contained in:
Jyoti Wadhwani 2018-07-30 15:39:24 -07:00
parent 9d43dc9738
commit f73635d51b
8 changed files with 15 additions and 35 deletions

View File

@ -38,12 +38,4 @@ public class DataTypesViewDao extends BaseViewDao {
throw new UnsupportedOperationException("Operation not implemented");
}
/**
* Get docs for all field format types
*/
public Map<String, String> getDocsForAllFieldFormats() throws Exception {
throw new UnsupportedOperationException("Operation not implemented");
}
}

View File

@ -144,16 +144,6 @@ public class Dataset extends Controller {
}
}
public static Promise<Result> getFieldFormatDocs() {
try {
return Promise.promise(() -> ok(
Json.newObject().set("fieldFormatDocs", Json.toJson(DATA_TYPES_DAO.getDocsForAllFieldFormats()))));
} catch (Exception e) {
Logger.error("Fail to get docs of field formats", e);
return Promise.promise(() -> notFound(errorResponse(e)));
}
}
public static Promise<Result> getDataPlatforms() {
try {
return Promise.promise(

View File

@ -33,7 +33,7 @@ public class AuthenticationManager {
LoginContext lc = null;
// authenticate using the jaas config
try {
lc = new LoginContext("WH-Authentication", new WHCallbackHandler(userName, password));
lc = new LoginContext("WHZ-Authentication", new WHZCallbackHandler(userName, password));
} catch (LoginException le) {
throw new AuthenticationException(le.toString());
} catch (SecurityException se) {
@ -47,10 +47,10 @@ public class AuthenticationManager {
}
}
private static class WHCallbackHandler implements CallbackHandler {
private static class WHZCallbackHandler implements CallbackHandler {
private String password = null;
private String username = null;
private WHCallbackHandler(String username, String password) {
private WHZCallbackHandler(String username, String password) {
this.username = username;
this.password = password;
}
@ -73,3 +73,4 @@ public class AuthenticationManager {
}
}

View File

@ -17,11 +17,6 @@ WHZ_ES_DATASET_URL="http://localhost:9200/wherehows/dataset/_search"
WHZ_ES_METRIC_URL="http://localhost:9200/wherehows/metric/_search"
WHZ_ES_FLOW_URL="http://localhost:9200/wherehows/flow_jobs/_search"
# LDAP
WHZ_LDAP_URL=your_ldap_url
WHZ_LDAP_PRINCIPAL_DOMAIN=your_ldap_principal_domain
WHZ_LDAP_SEARCH_BASE=your_ldap_search_base
# Piwik tracking configuration
PIWIK_SITE_ID="0000" # change_to_your_piwik_id
PIWIK_URL="change_to_your_piwik_url"

View File

@ -80,11 +80,6 @@ elasticsearch.dataset.url = ${WHZ_ES_DATASET_URL}
elasticsearch.metric.url = ${WHZ_ES_METRIC_URL}
elasticsearch.flow.url = ${WHZ_ES_FLOW_URL}
authentication.ldap.context_factory_class = "com.sun.jndi.ldap.LdapCtxFactory"
authentication.ldap.url = ${WHZ_LDAP_URL}
authentication.principal.domain = ${WHZ_LDAP_PRINCIPAL_DOMAIN}
authentication.ldap.search.base = ${WHZ_LDAP_SEARCH_BASE}
dataset.hdfs_browser.link = "https://localhost:8888/filebrowser/#"
dataset.hdfs_browser.link = ${?YOUR_HDFS_BROWSER_LINK}

View File

@ -0,0 +1,9 @@
WHZ-Authentication {
com.sun.security.auth.module.LdapLoginModule sufficient
userProvider="<WHZ_LDAP_URL>"
authIdentity="{USERNAME}"
userFilter="<USER_FILTER>"
java.naming.security.authentication="simple"
debug="false"
useSSL="true";
};

View File

@ -270,8 +270,6 @@ GET /api/v2/list/platforms
GET /api/v2/list/compliance-data-types controllers.api.v2.Dataset.getComplianceDataTypes
GET /api/v2/list/field-format-docs controllers.api.v2.Dataset.getFieldFormatDocs
GET /api/v2/platforms/:platform/prefix/:prefix controllers.api.v2.Dataset.listSegments(platform: String, prefix: String)
GET /api/v2/platforms/:platform controllers.api.v2.Dataset.listSegments(platform: String, prefix = "")

View File

@ -3,6 +3,6 @@ set -a
source ./application.env
set +a
export JAVA_OPTS="-Xms512m -Xmx2048m -Dhttp.port=9000"
export JAVA_OPTS="-Xms512m -Xmx2048m -Dhttp.port=9000 -Djava.security.auth.login.config=conf/jaas.conf"
build/stage/wherehows-frontend/bin/playBinary