Examples of addConstraintMapping()


Examples of org.eclipse.jetty.security.ConstraintAware.addConstraintMapping()

       //set up the security constraints produced by the annotation
       ConstraintAware securityHandler = (ConstraintAware)_context.getSecurityHandler();

       for (ConstraintMapping m:constraintMappings)
           securityHandler.addConstraintMapping(m);
      
       //Servlet Spec 3.1 requires paths with uncovered http methods to be reported
       securityHandler.checkPathsWithUncoveredHttpMethods();
    }
View Full Code Here

Examples of org.eclipse.jetty.security.ConstraintAware.addConstraintMapping()

       //set up the security constraints produced by the annotation
       ConstraintAware securityHandler = (ConstraintAware)_context.getSecurityHandler();

       for (ConstraintMapping m:constraintMappings)
           securityHandler.addConstraintMapping(m);
      
       //Servlet Spec 3.1 requires paths with uncovered http methods to be reported
       securityHandler.checkPathsWithUncoveredHttpMethods();
    }
View Full Code Here

Examples of org.eclipse.jetty.security.ConstraintSecurityHandler.addConstraintMapping()

    cm.setConstraint(constraint);
    cm.setPathSpec("/*");
    ConstraintSecurityHandler csh = new ConstraintSecurityHandler();
    csh.setAuthenticator(new BasicAuthenticator());
    csh.setRealmName("SecureRealm");
    csh.addConstraintMapping(cm);
    HashLoginService loginService = new HashLoginService();
    loginService.putUser("beaker", Credential.getCredential(password),
                         new String[]{"user"});
    csh.setLoginService(loginService);
    return csh;
View Full Code Here

Examples of org.eclipse.jetty.security.ConstraintSecurityHandler.addConstraintMapping()

    cm.setConstraint(constraint);
    cm.setPathSpec("/*");
    ConstraintSecurityHandler csh = new ConstraintSecurityHandler();
    csh.setAuthenticator(new BasicAuthenticator());
    csh.setRealmName("SecureRealm");
    csh.addConstraintMapping(cm);
    HashLoginService loginService = new HashLoginService();
    loginService.putUser("beaker", Credential.getCredential(password),
                         new String[]{"user"});
    csh.setLoginService(loginService);
    return csh;
View Full Code Here

Examples of org.eclipse.jetty.security.ConstraintSecurityHandler.addConstraintMapping()

            for( ConstraintService eachConstraintService : constraintServices )
            {
                ConstraintMapping csMapping = eachConstraintService.buildConstraintMapping();
                if( csMapping != null )
                {
                    securityHandler.addConstraintMapping( csMapping );
                }
            }
            if( !securityHandler.getConstraintMappings().isEmpty() )
            {
                return securityHandler;
View Full Code Here

Examples of org.eclipse.jetty.security.ConstraintSecurityHandler.addConstraintMapping()

        constraint.setRoles(new String[]{"**"}); //allow any authenticated user
        ConstraintMapping mapping = new ConstraintMapping();
        mapping.setPathSpec("/secure");
        mapping.setConstraint(constraint);

        securityHandler.addConstraintMapping(mapping);
        securityHandler.setAuthenticator(authenticator);
        securityHandler.setLoginService(loginService);

        securityHandler.setHandler(handler);
        start(securityHandler);
View Full Code Here

Examples of org.eclipse.jetty.security.ConstraintSecurityHandler.addConstraintMapping()

        cm.setPathSpec("/*");

        ConstraintSecurityHandler csh = new ConstraintSecurityHandler();
        csh.setAuthenticator(new BasicAuthenticator());
        csh.setRealmName(realm);
        csh.addConstraintMapping(cm);
        csh.setLoginService(l);

        return csh;

    }
View Full Code Here

Examples of org.eclipse.jetty.security.ConstraintSecurityHandler.addConstraintMapping()

        for (Entry<String, Constraint> constraint : constraints.entrySet()) {
            ConstraintMapping constraintMapping = new ConstraintMapping();
            constraintMapping.setConstraint(constraint.getValue());
            constraintMapping.setPathSpec(constraint.getKey());
           
            securityHandler.addConstraintMapping(constraintMapping);
        }
       
        for (User user : users) {
            loginService.putUser(user.getName(), Credential.getCredential(user.getPassword()), user.getRoles());
        }
View Full Code Here

Examples of org.eclipse.jetty.security.ConstraintSecurityHandler.addConstraintMapping()

    cm.setConstraint(constraint);
    cm.setPathSpec("/*");

    ConstraintSecurityHandler csh = new ConstraintSecurityHandler();
    csh.setAuthenticator(new BasicAuthenticator());
    csh.addConstraintMapping(cm);
    csh.setLoginService(login);
    csh.setHandler(handler);
    return csh;
  }

View Full Code Here

Examples of org.eclipse.jetty.security.ConstraintSecurityHandler.addConstraintMapping()

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

      ConstraintSecurityHandler sh = new ConstraintSecurityHandler();
      sh.addConstraintMapping(mapping);
      sh.setAuthenticator(new BasicAuthenticator());
      sh.setLoginService(loginService);
      sh.setStrict(true);

      // set the handers: the server hands the request to the security handler,
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.