Search in sources :

Example 1 with PamConstraint

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);
}
Also used : ConstraintMapping(org.eclipse.jetty.security.ConstraintMapping) PamConstraintMapping(org.apache.hive.http.security.PamConstraintMapping) PamConstraint(org.apache.hive.http.security.PamConstraint) PamConstraint(org.apache.hive.http.security.PamConstraint) Constraint(org.eclipse.jetty.util.security.Constraint) PamConstraintMapping(org.apache.hive.http.security.PamConstraintMapping) ConstraintSecurityHandler(org.eclipse.jetty.security.ConstraintSecurityHandler) PamLoginService(org.apache.hive.http.security.PamLoginService) LoginService(org.eclipse.jetty.security.LoginService) PamLoginService(org.apache.hive.http.security.PamLoginService)

Aggregations

PamConstraint (org.apache.hive.http.security.PamConstraint)1 PamConstraintMapping (org.apache.hive.http.security.PamConstraintMapping)1 PamLoginService (org.apache.hive.http.security.PamLoginService)1 ConstraintMapping (org.eclipse.jetty.security.ConstraintMapping)1 ConstraintSecurityHandler (org.eclipse.jetty.security.ConstraintSecurityHandler)1 LoginService (org.eclipse.jetty.security.LoginService)1 Constraint (org.eclipse.jetty.util.security.Constraint)1