use of org.apache.hive.http.security.PamConstraint in project hive by apache.
the class HttpServer method setupPam.
/**
* Secure the web server with PAM.
*/
void setupPam(Builder b, Handler handler) {
LoginService loginService = new PamLoginService();
webServer.addBean(loginService);
ConstraintSecurityHandler security = new ConstraintSecurityHandler();
Constraint constraint = new PamConstraint();
ConstraintMapping mapping = new PamConstraintMapping(constraint);
security.setConstraintMappings(Collections.singletonList(mapping));
security.setAuthenticator(b.pamAuthenticator);
security.setLoginService(loginService);
security.setHandler(handler);
webServer.setHandler(security);
}
Aggregations