Package org.eclipse.jetty.security

Examples of org.eclipse.jetty.security.ConstraintMapping


        constraintMapping.setConstraint(constraint);
        return constraintMapping;
    }

    protected ConstraintMapping forbidden(String method, String url) {
        ConstraintMapping constraintMapping = new ConstraintMapping();
        Constraint constraint = new Constraint();
        constraintMapping.setMethod(method);
        constraintMapping.setPathSpec(url);
        constraint.setAuthenticate(true);
        constraintMapping.setConstraint(constraint);
        return constraintMapping;
    }
View Full Code Here


        ConstraintSecurityHandler securityHandler = new ConstraintSecurityHandler();
        securityHandler.setAuthenticator(authenticator);
        securityHandler.setRealmName(realm);
       
        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) {
View Full Code Here

            if(login != AuthenticationType.NONE) {
                Authenticator authenticator = login.createAuthenticator();
                Constraint constraint = new Constraint(authenticator.getAuthMethod(), REST_ROLE);
                constraint.setAuthenticate(true);

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

                ConstraintSecurityHandler sh =
                        crossOriginOn ? new CrossOriginConstraintSecurityHandler() : new ConstraintSecurityHandler();
                sh.setAuthenticator(authenticator);
                sh.setConstraintMappings(Collections.singletonList(cm));
View Full Code Here

    private SecurityHandler getSecurityHandler() throws IOException {
        Constraint constraint = new Constraint(Constraint.__BASIC_AUTH, "user");
        constraint.setAuthenticate(true);

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

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

    private SecurityHandler getSecurityHandler() throws IOException {
        Constraint constraint = new Constraint(Constraint.__BASIC_AUTH, "user");
        constraint.setAuthenticate(true);

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

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

View Full Code Here

    private SecurityHandler getSecurityHandler() throws IOException {
        Constraint constraint = new Constraint(Constraint.__BASIC_AUTH, "user");
        constraint.setAuthenticate(true);

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

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

View Full Code Here

    }
   
    Constraint userConstraint = new Constraint();
    userConstraint.setRoles(new String[] {"user"});
    userConstraint.setAuthenticate(true);
    ConstraintMapping restrictedConstraintMapping = new ConstraintMapping();
    restrictedConstraintMapping.setConstraint(userConstraint);
    restrictedConstraintMapping.setPathSpec("/*");
   
    Constraint noAuthenticationConstraint = new Constraint();
    noAuthenticationConstraint.setAuthenticate(false);
    ConstraintMapping publicConstraintMapping = new ConstraintMapping();
    publicConstraintMapping.setConstraint(noAuthenticationConstraint);
    publicConstraintMapping.setPathSpec("/jax/bundles/fm/prototype/login.ftl");
   
    JAASLoginService loginService = new JAASLoginService("OpenGamma");
    loginService.setLoginModuleName("og");
    server.addBean(loginService);

View Full Code Here

      Constraint constraint = new Constraint();
      constraint.setName(Constraint.__BASIC_AUTH);
      constraint.setAuthenticate(true);
      constraint.setRoles(new String[] { "user" });

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

      ConstraintSecurityHandler sh = new ConstraintSecurityHandler();
      sh.addConstraintMapping(mapping);
      sh.setAuthenticator(new BasicAuthenticator());
      sh.setLoginService(loginService);
View Full Code Here

      Constraint constraint = new Constraint();
      constraint.setName(Constraint.__BASIC_AUTH);
      constraint.setAuthenticate(true);
      constraint.setRoles(new String[] { "user" });

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

      ConstraintSecurityHandler sh = new ConstraintSecurityHandler();
      sh.addConstraintMapping(mapping);
      sh.setAuthenticator(new BasicAuthenticator());
      sh.setLoginService(loginService);
View Full Code Here

TOP

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

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.