Search in sources :

Example 11 with Password

use of org.eclipse.jetty.util.security.Password in project jena by apache.

the class FusekiTestAuth method makeUserStore.

/** Very simple! */
private static UserStore makeUserStore(String user, String password, String role) {
    Credential cred = new Password(password);
    PropertyUserStore propertyUserStore = new PropertyUserStore();
    String[] roles = role == null ? null : new String[] { role };
    propertyUserStore.addUser(user, cred, roles);
    try {
        propertyUserStore.start();
    } catch (Exception ex) {
        throw new FusekiException("UserStore", ex);
    }
    return propertyUserStore;
}
Also used : Credential(org.eclipse.jetty.util.security.Credential) FusekiException(org.apache.jena.fuseki.FusekiException) HttpException(org.apache.jena.atlas.web.HttpException) FusekiException(org.apache.jena.fuseki.FusekiException) Password(org.eclipse.jetty.util.security.Password)

Aggregations

Password (org.eclipse.jetty.util.security.Password)11 Server (org.eclipse.jetty.server.Server)6 Constraint (org.eclipse.jetty.util.security.Constraint)5 IOException (java.io.IOException)4 ConstraintMapping (org.eclipse.jetty.security.ConstraintMapping)4 ConstraintSecurityHandler (org.eclipse.jetty.security.ConstraintSecurityHandler)4 LocalConnector (org.eclipse.jetty.server.LocalConnector)4 ContextHandler (org.eclipse.jetty.server.handler.ContextHandler)4 SessionHandler (org.eclipse.jetty.server.session.SessionHandler)3 BeforeClass (org.junit.BeforeClass)3 UnsupportedCallbackException (javax.security.auth.callback.UnsupportedCallbackException)2 AuthException (javax.security.auth.message.AuthException)2 HttpServletRequest (javax.servlet.http.HttpServletRequest)2 HttpServletResponse (javax.servlet.http.HttpServletResponse)2 HashLoginService (org.eclipse.jetty.security.HashLoginService)2 BasicAuthenticator (org.eclipse.jetty.security.authentication.BasicAuthenticator)2 DefaultHandler (org.eclipse.jetty.server.handler.DefaultHandler)2 HandlerList (org.eclipse.jetty.server.handler.HandlerList)2 ResourceHandler (org.eclipse.jetty.server.handler.ResourceHandler)2 Before (org.junit.Before)2