Package org.eclipse.jetty.security

Examples of org.eclipse.jetty.security.HashLoginService


    /**
     * Initialize member variables if not set by user in application context.
     */
    public void afterPropertiesSet() throws Exception {
        if (loginService == null) {
            loginService = new HashLoginService();
            ((HashLoginService)loginService).setName(realm);
        }
    }
View Full Code Here


        ConstraintSecurityHandler sh = new ConstraintSecurityHandler();
        sh.setAuthenticator(new BasicAuthenticator());
        sh.setConstraintMappings(Arrays.asList(new ConstraintMapping[] {cm}));
       
        HashLoginService loginService = new HashLoginService("MyRealm", "src/test/resources/myRealm.properties");
        sh.setLoginService(loginService);
        sh.setConstraintMappings(Arrays.asList(new ConstraintMapping[]{cm}));

        return sh;
    }
View Full Code Here

        ConstraintSecurityHandler sh = new ConstraintSecurityHandler();
        sh.setAuthenticator(new BasicAuthenticator());
        sh.setConstraintMappings(Arrays.asList(new ConstraintMapping[] {cm}));

        HashLoginService loginService = new HashLoginService("MyRealm", "src/test/resources/myRealm.properties");
        sh.setLoginService(loginService);
        sh.setConstraintMappings(Arrays.asList(new ConstraintMapping[]{cm}));

        return sh;
    }
View Full Code Here

        ConstraintSecurityHandler sh = new ConstraintSecurityHandler();
        sh.setAuthenticator(new BasicAuthenticator());
        sh.setConstraintMappings(Arrays.asList(new ConstraintMapping[] {cm}));

        HashLoginService loginService = new HashLoginService("MyRealm", "src/test/resources/myRealm.properties");
        sh.setLoginService(loginService);
        sh.setConstraintMappings(Arrays.asList(new ConstraintMapping[]{cm}));

        return sh;
    }
View Full Code Here

     * @param server
     *
     * @throws IOException
     */
    private void configureHashRealms(final Server server) throws IOException {
        HashLoginService realm = new HashLoginService();
        realm.setName(REALM_NAME);
        final File conffile = new File(configdir, "realm.properties");
        realm.setConfig(conffile.getAbsolutePath());
        server.addBean(realm);
    }
View Full Code Here

    protected void configureServer() throws Exception {
        URL resource = getClass()
            .getResource("jetty-realm.properties");
        LoginService realm =
            new HashLoginService("BookStoreRealm", resource.toString());
        server.addBean(realm);
    }
View Full Code Here

    @Override
    protected void configureServer(org.eclipse.jetty.server.Server server) throws Exception {
        URL resource = getClass()
            .getResource("/org/apache/cxf/systest/jaxrs/security/jetty-realm.properties");
        LoginService realm =
            new HashLoginService("BookStoreRealm", resource.toURI().getPath());
        server.addBean(realm);
    }
View Full Code Here

          + "' with the authentication information is missing. Starting server without HTTP authentication.");
        af = null;
      }
    }
    if (af != null) {
      HashLoginService loginService = new HashLoginService("Stratosphere Jobmanager Interface", authFile);
      server.addBean(loginService);

      Constraint constraint = new Constraint();
      constraint.setName(Constraint.__BASIC_AUTH);
      constraint.setAuthenticate(true);
View Full Code Here

          + "' with the authentication information is missing. Starting server without HTTP authentication.");
        af = null;
      }
    }
    if (af != null) {
      HashLoginService loginService = new HashLoginService("Stratosphere Query Engine Interface", authFile);
      server.addBean(loginService);

      Constraint constraint = new Constraint();
      constraint.setName(Constraint.__BASIC_AUTH);
      constraint.setAuthenticate(true);
View Full Code Here

        if(!Strings.isNullOrEmpty(webInfLocation)) {
            ctx.setDescriptor(webInfLocation);
        }
        // configure security to avoid err println "Null identity service, trying login service:"
        // but I've found no way to get rid of LoginService=xxx log on system err :(
        HashLoginService loginService = new HashLoginService();
        loginService.setIdentityService(new DefaultIdentityService());
        ctx.getSecurityHandler().setLoginService(loginService);
        ctx.getSecurityHandler().setIdentityService(loginService.getIdentityService());

        ctx.addLifeCycleListener(new AbstractLifeCycle.AbstractLifeCycleListener() {
            @Override
            public void lifeCycleStarting(LifeCycle event) {
                ctx.getServletContext().setInitParameter("restx.baseServerUri", baseUrl());
View Full Code Here

TOP

Related Classes of org.eclipse.jetty.security.HashLoginService

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.