Package org.mortbay.jetty.security

Examples of org.mortbay.jetty.security.HashUserRealm$User


        ConstraintMapping cm = new ConstraintMapping();
        cm.setConstraint( constraint );
        cm.setPathSpec( "/*" );

        TestSecurityHandler sh = new TestSecurityHandler();
        HashUserRealm hashUserRealm = new HashUserRealm( "MyRealm" );
        hashUserRealm.put( "user", "secret" );
        hashUserRealm.addUserToRole( "user", "admin" );
        sh.setUserRealm( hashUserRealm );
        sh.setConstraintMappings( new ConstraintMapping[]{ cm } );
        return sh;
    }
View Full Code Here


        // configure embedded jetty web application handler
    server.addHandler(context);
   
        // configure embedded jetty authentication realm
    HashUserRealm authedRealm = new HashUserRealm("Authentication Required","etc/jetty-realm.properties");
    server.setUserRealms(new UserRealm[]{authedRealm});

    logger.info("Configured Jetty server");
  }
View Full Code Here

       
        // TODO add javadoc context to contexts
       
        WebAppContext.addWebApplications(server, "../../webapps", "org/mortbay/jetty/webapp/webdefault.xml", true, false);
       
        HashUserRealm userRealm = new HashUserRealm();
        userRealm.setName("Test Realm");
        userRealm.setConfig("../../etc/realm.properties");
        server.setUserRealms(new UserRealm[]{userRealm});
       
       
        server.start();
        server.join();
View Full Code Here

       
        contexts.setHandlers(new Handler[]{wah});
        handlers.setHandlers(new Handler[]{contexts,new DefaultHandler()});
        server.setHandler(handlers);

        HashUserRealm hur = new HashUserRealm();
        hur.setName("Test Realm");
        hur.setConfig(jetty_home+"/etc/realm.properties");
        wah.getSecurityHandler().setUserRealm(hur);
       
        server.start();
        server.join();
    }
View Full Code Here

        ConstraintMapping cm = new ConstraintMapping();
        cm.setConstraint( constraint );
        cm.setPathSpec( "/*" );

        TestSecurityHandler sh = new TestSecurityHandler();
        HashUserRealm hashUserRealm = new HashUserRealm( "MyRealm" );
        hashUserRealm.put( "user", "secret" );
        hashUserRealm.addUserToRole( "user", "admin" );
        sh.setUserRealm( hashUserRealm );
        sh.setConstraintMappings( new ConstraintMapping[]{ cm } );
        return sh;
    }
View Full Code Here

            ConstraintMapping cm = new ConstraintMapping();
            cm.setConstraint(constraint);
            cm.setPathSpec("/*");

            SecurityHandler sh = new SecurityHandler();
            sh.setUserRealm(new HashUserRealm("MyRealm", getClass().getResource("/TestEndpointProperties/jetty-realm.properties").toURI().toString()));
            sh.setConstraintMappings(new ConstraintMapping[]{cm});

            securedEchoContext = new ContextHandler();
            securedEchoContext.setContextPath("/EchoService");

View Full Code Here

        final SecurityHandler sh = new SecurityHandler();
        sh.setHandler(new PilotNotificationHTTPHandler_v01(slotcall,
                                                           execService,
                                                           this.lager));
        sh.setUserRealm(new HashUserRealm("pilotrealm", accountsPath));
        sh.setConstraintMappings(new ConstraintMapping[]{cm});
        sh.setAuthMethod(Constraint.__DIGEST_AUTH);

        this.server.setHandler(sh);
    }
View Full Code Here

    // configure embedded jetty web application handler
    server.addHandler(context);

    // configure embedded jetty authentication realm
    HashUserRealm authedRealm = new HashUserRealm("Authentication Required","etc/jetty-realm.properties");
    server.setUserRealms(new UserRealm[]{authedRealm});

    logger.info("Configured Jetty server");
  }
View Full Code Here

            ConstraintMapping cm = new ConstraintMapping();
            cm.setConstraint( constraint );
            cm.setPathSpec( "/*" );

            SecurityHandler sh = new SecurityHandler();
            sh.setUserRealm( new HashUserRealm( "MyRealm", getBasedir() + "/src/test/resources/realm.properties" ) );
            sh.setConstraintMappings( new ConstraintMapping[] { cm } );

            webapp.addHandler( sh );
        }

View Full Code Here

        SecurityHandler authWrapper = new SecurityHandler();
        authWrapper.setAuthenticator(authenticator);
       
        authWrapper.setConstraintMappings(new ConstraintMapping[] {constraintMapping});
        authWrapper.setUserRealm(new HashUserRealm(realm) {
            {
                put(login, password);
                addUserToRole(login, role);
            }
        });
View Full Code Here

TOP

Related Classes of org.mortbay.jetty.security.HashUserRealm$User

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.