Search in sources :

Example 1 with DrillRestLoginService

use of org.apache.drill.exec.server.rest.auth.DrillRestLoginService in project drill by apache.

the class WebServer method createSecurityHandler.

/**
   * @return {@link SecurityHandler} with appropriate {@link LoginService}, {@link Authenticator} and constraints.
   */
private ConstraintSecurityHandler createSecurityHandler() {
    ConstraintSecurityHandler security = new ConstraintSecurityHandler();
    Set<String> knownRoles = ImmutableSet.of(AUTHENTICATED_ROLE, ADMIN_ROLE);
    security.setConstraintMappings(Collections.<ConstraintMapping>emptyList(), knownRoles);
    security.setAuthenticator(new FormAuthenticator("/login", "/login", true));
    security.setLoginService(new DrillRestLoginService(workManager.getContext()));
    return security;
}
Also used : ConstraintSecurityHandler(org.eclipse.jetty.security.ConstraintSecurityHandler) FormAuthenticator(org.eclipse.jetty.security.authentication.FormAuthenticator) DrillRestLoginService(org.apache.drill.exec.server.rest.auth.DrillRestLoginService)

Aggregations

DrillRestLoginService (org.apache.drill.exec.server.rest.auth.DrillRestLoginService)1 ConstraintSecurityHandler (org.eclipse.jetty.security.ConstraintSecurityHandler)1 FormAuthenticator (org.eclipse.jetty.security.authentication.FormAuthenticator)1