Package org.eclipse.jetty.security.authentication

Examples of org.eclipse.jetty.security.authentication.FormAuthenticator


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

    security.setConstraintMappings(Arrays
        .asList(new ConstraintMapping[] { cm }));
    final FormAuthenticator fa = new FormAuthenticator(
        WebApplication.ControllerResource.LOGIN.path(),
        WebApplication.ControllerResource.ERROR.path(), false);
    security.setAuthenticator(fa);
    // security.setAuthenticator(new DigestAuthenticator());
    security.setLoginService(loginService);
View Full Code Here


            authenticator = new DigestAuthenticator();
        } else if (authMethod == BuiltInAuthMethod.CLIENTCERT) {
            authenticator = new ClientCertAuthenticator();
        } else if (authMethod == BuiltInAuthMethod.FORM) {
            boolean dispatch = true;
            authenticator = new FormAuthenticator(loginPage, errorPage, dispatch);
        } else if (authMethod == BuiltInAuthMethod.NONE) {
            authenticator = new NoneAuthenticator();
        } else {
            throw new IllegalStateException("someone added a new BuiltInAuthMethod without telling us");
        }
View Full Code Here

    protected WebAppContextWrapper setUpSecureAppContext(String securityRealmName, Map<String, SubjectInfo> roleDesignates, Map<Principal, Set<String>> principalRoleMap, ComponentPermissions componentPermissions, SubjectInfo defaultSubjectInfo, PermissionCollection checked, Set securityRoles) throws Exception {
        String policyContextId = "TEST";
        ApplicationPolicyConfigurationManager jacc = setUpJACC(roleDesignates, principalRoleMap, componentPermissions, policyContextId);
        LoginService loginService = newLoginService();
        Authenticator serverAuthentication = new FormAuthenticator("/auth/logon.html?param=test", "/auth/logonError.html?param=test", true);
        SecurityHandlerFactory securityHandlerFactory = new ServerAuthenticationGBean(serverAuthentication, loginService);
        return setUpAppContext(
                securityRealmName,
                securityHandlerFactory,
                policyContextId,
View Full Code Here

    protected WebAppContextWrapper setUpSecureAppContext(String securityRealmName, Map<String, SubjectInfo> roleDesignates, Map<Principal, Set<String>> principalRoleMap, ComponentPermissions componentPermissions, SubjectInfo defaultSubjectInfo, PermissionCollection checked, Set securityRoles) throws Exception {
        String policyContextId = "TEST";
        ApplicationPolicyConfigurationManager jacc = setUpJACC(roleDesignates, principalRoleMap, componentPermissions, policyContextId);
        LoginService loginService = newLoginService();
//        Authenticator serverAuthentication = new FormAuthenticator("/auth/logon.html?param=test", "/auth/logonError.html?param=test", true);
        Authenticator serverAuthentication = new FormAuthenticator("/auth/logon.html?param=test", "/auth/logonError.html?param=test", true);
        SecurityHandlerFactory securityHandlerFactory = new ServerAuthenticationGBean(serverAuthentication, loginService);
        WebAppInfo webAppInfo = new WebAppInfo();
        setUpStaticContentServlet(webAppInfo);
        return setUpAppContext(
                securityRealmName,
View Full Code Here

        } else if (authMethod == BuiltInAuthMethod.DIGEST) {
            authenticator = new DigestAuthenticator();
        } else if (authMethod == BuiltInAuthMethod.CLIENTCERT) {
            authenticator = new ClientCertAuthenticator();
        } else if (authMethod == BuiltInAuthMethod.FORM) {
            authenticator = new FormAuthenticator(loginPage, errorPage, true);
        } else if (authMethod == BuiltInAuthMethod.NONE) {
            authenticator = new NoneAuthenticator();
        } else {
            throw new IllegalStateException("someone added a new BuiltInAuthMethod without telling us");
        }
View Full Code Here

    protected WebAppContextWrapper setUpSecureAppContext(String securityRealmName, Map<String, SubjectInfo> roleDesignates, Map<Principal, Set<String>> principalRoleMap, ComponentPermissions componentPermissions, SubjectInfo defaultSubjectInfo, PermissionCollection checked, Set securityRoles) throws Exception {
        String policyContextId = "TEST";
        ApplicationPolicyConfigurationManager jacc = setUpJACC(roleDesignates, principalRoleMap, componentPermissions, policyContextId);
        LoginService loginService = newLoginService();
//        Authenticator serverAuthentication = new FormAuthenticator("/auth/logon.html?param=test", "/auth/logonError.html?param=test", true);
        Authenticator serverAuthentication = new FormAuthenticator("/auth/logon.html?param=test", "/auth/logonError.html?param=test", true);
        SecurityHandlerFactory securityHandlerFactory = new ServerAuthenticationGBean(serverAuthentication, loginService);
        WebAppInfo webAppInfo = new WebAppInfo();
        setUpStaticContentServlet(webAppInfo);
        return setUpAppContext(
                securityRealmName,
View Full Code Here

        } else if (authMethod == BuiltInAuthMethod.DIGEST) {
            authenticator = new DigestAuthenticator();
        } else if (authMethod == BuiltInAuthMethod.CLIENTCERT) {
            authenticator = new ClientCertAuthenticator();
        } else if (authMethod == BuiltInAuthMethod.FORM) {
            authenticator = new FormAuthenticator(loginPage, errorPage, true);
        } else if (authMethod == BuiltInAuthMethod.NONE) {
            authenticator = new NoneAuthenticator();
        } else {
            throw new IllegalStateException("someone added a new BuiltInAuthMethod without telling us");
        }
View Full Code Here

    protected WebAppContextWrapper setUpSecureAppContext(String securityRealmName, Map<String, SubjectInfo> roleDesignates, Map<Principal, Set<String>> principalRoleMap, ComponentPermissions componentPermissions, SubjectInfo defaultSubjectInfo, PermissionCollection checked, Set securityRoles) throws Exception {
        String policyContextId = "TEST";
        ApplicationPolicyConfigurationManager jacc = setUpJACC(roleDesignates, principalRoleMap, componentPermissions, policyContextId);
        LoginService loginService = newLoginService();
//        Authenticator serverAuthentication = new FormAuthenticator("/auth/logon.html?param=test", "/auth/logonError.html?param=test", true);
        Authenticator serverAuthentication = new FormAuthenticator("/auth/logon.html?param=test", "/auth/logonError.html?param=test", true);
        SecurityHandlerFactory securityHandlerFactory = new ServerAuthenticationGBean(serverAuthentication, loginService);
        return setUpAppContext(
                securityRealmName,
                securityHandlerFactory,
                policyContextId,
View Full Code Here

        } else if (authMethod == BuiltInAuthMethod.CLIENTCERT) {
            authenticator = new ClientCertAuthenticator();
        } else if (authMethod == BuiltInAuthMethod.FORM) {
            boolean dispatch = true;
//            authenticator = new FormAuthenticator(loginPage, errorPage, dispatch);
            authenticator = new FormAuthenticator(loginPage, errorPage, true);
        } else if (authMethod == BuiltInAuthMethod.NONE) {
            authenticator = new NoneAuthenticator();
        } else {
            throw new IllegalStateException("someone added a new BuiltInAuthMethod without telling us");
        }
View Full Code Here

    Authenticator authenticator = webappContext.getSecurityHandler().getAuthenticator();

    if (authenticator instanceof FormAuthenticator)
    {
      FormAuthenticator formAuthenticator = (FormAuthenticator) authenticator;
      formAuthenticator.setAlwaysSaveUri(true);
    }
    return webappContext;
  }
View Full Code Here

TOP

Related Classes of org.eclipse.jetty.security.authentication.FormAuthenticator

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.