Package org.mortbay.http

Examples of org.mortbay.http.HashUserRealm


        constraint.addRole("user");
        constraint.setAuthenticate(true);

        context.addSecurityConstraint("/tests/html/basicAuth/*", constraint);
        HashUserRealm realm = new HashUserRealm("MyRealm");
        realm.put("alice", "foo");
        realm.addUserToRole("alice", "user");
        context.setRealm(realm);

        SecurityHandler sh = new SecurityHandler();
        context.addHandler(sh);
    }
View Full Code Here


        constraint.setName(SecurityConstraint.__BASIC_AUTH);;
        constraint.addRole("user");
        constraint.setAuthenticate(true);

        context.addSecurityConstraint("/tests/html/basicAuth/*", constraint);
        HashUserRealm realm = new HashUserRealm("MyRealm");
        realm.put("alice", "foo");
        realm.addUserToRole("alice", "user");
        context.setRealm(realm);
       
        SecurityHandler sh = new SecurityHandler();
        context.addHandler(sh);

View Full Code Here

        throws ClassNotFoundException, InstantiationException, IllegalAccessException
    {
        AuthenticationInfo authenticationInfo = wdc.getAuthenticationInfo();
        if ( authenticationInfo != null )
        {
            HashUserRealm userRealm = new HashUserRealm( "basic" );
            userRealm.put( authenticationInfo.getUserName(), authenticationInfo.getPassword() );
            context.getHttpServer().addRealm( userRealm );

            context.setAuthenticator( new BasicAuthenticator() );
            context.addSecurityConstraint( "/*", new SecurityConstraint( "any", SecurityConstraint.ANY_ROLE ) );
            context.addHandler( new SecurityHandler() );
View Full Code Here

        constraint.addRole("user");
        constraint.setAuthenticate(true);

        context.addSecurityConstraint("/tests/html/basicAuth/*", constraint);
        HashUserRealm realm = new HashUserRealm("MyRealm");
        realm.put("alice", "foo");
        realm.addUserToRole("alice", "user");
        context.setRealm(realm);

        SecurityHandler sh = new SecurityHandler();
        context.addHandler(sh);
    }
View Full Code Here

        constraint.addRole("user");
        constraint.setAuthenticate(true);

        context.addSecurityConstraint("/tests/html/basicAuth/*", constraint);
        HashUserRealm realm = new HashUserRealm("MyRealm");
        realm.put("alice", "foo");
        realm.addUserToRole("alice", "user");
        context.setRealm(realm);

        SecurityHandler sh = new SecurityHandler();
        context.addHandler(sh);
    }
View Full Code Here

            setupServer();
           
            HttpContext context = createContext();

            URL url = this.getClass().getResource("/testuser.properties");           
            UserRealm ur = new HashUserRealm("test", url.getFile());           
            context.setRealm(ur);

            BasicAuthenticator ba = new BasicAuthenticator();
            context.setAuthenticator(ba);   
           
View Full Code Here

        throws ClassNotFoundException, InstantiationException, IllegalAccessException
    {
        AuthenticationInfo authenticationInfo = wdc.getAuthenticationInfo();
        if ( authenticationInfo != null )
        {
            HashUserRealm userRealm = new HashUserRealm( "basic" );
            userRealm.put( authenticationInfo.getUserName(), authenticationInfo.getPassword() );
            context.getHttpServer().addRealm( userRealm );

            context.setAuthenticator( new BasicAuthenticator() );
            context.addSecurityConstraint( "/*", new SecurityConstraint( "any", SecurityConstraint.ANY_ROLE ) );
            context.addHandler( new SecurityHandler() );
View Full Code Here

            setupServer();
           
            HttpContext context = createContext();

            URL url = this.getClass().getResource("/testuser.properties");           
            UserRealm ur = new HashUserRealm("test", url.getFile());           
            context.setRealm(ur);

            BasicAuthenticator ba = new BasicAuthenticator();
            context.setAuthenticator(ba);   
           
View Full Code Here

TOP

Related Classes of org.mortbay.http.HashUserRealm

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.