Package io.undertow.security.impl

Examples of io.undertow.security.impl.BasicAuthenticationMechanism


                        String[] mechanisms = mechName.split(",");
                        for (String mechanism : mechanisms) {
                            if (mechanism.equalsIgnoreCase(BASIC_AUTH)) {
                                // The mechanism name is passed in from the HttpServletRequest interface as the name reported needs to be
                                // comparable using '=='
                                authenticationMechanisms.add(new BasicAuthenticationMechanism(loginConfig.getRealmName(), BASIC_AUTH));
                            } else if (mechanism.equalsIgnoreCase("BASIC-SILENT")) {
                                //slient basic auth with use the basic headers if available, but will never challenge
                                //this allows programtic clients to use basic auth, and browsers to use other mechanisms
                                authenticationMechanisms.add(new BasicAuthenticationMechanism(loginConfig.getRealmName(), "BASIC-SILENT", true));
                            } else if (mechanism.equalsIgnoreCase(FORM_AUTH)) {
                                // The mechanism name is passed in from the HttpServletRequest interface as the name reported needs to be
                                // comparable using '=='
                                authenticationMechanisms.add(new ServletFormAuthenticationMechanism(FORM_AUTH, loginConfig.getLoginPage(),
                                        loginConfig.getErrorPage()));
View Full Code Here


            authenticationMechanisms.add(new CachedAuthenticatedSessionMechanism());

            String requestedMechanism = loginConfig.getAuthMethod();
            if (requestedMechanism.equalsIgnoreCase(BASIC_AUTH)) {
                // The mechanism name is passed in from the HttpServletRequest interface as the name reported needs to be comparable using '=='
                authenticationMechanisms.add(new BasicAuthenticationMechanism(loginConfig.getRealmName(), BASIC_AUTH));
            } else if (requestedMechanism.equalsIgnoreCase(FORM_AUTH)) {
                // The mechanism name is passed in from the HttpServletRequest interface as the name reported needs to be comparable using '=='
                authenticationMechanisms.add(new ServletFormAuthenticationMechanism(FORM_AUTH, loginConfig.getLoginPage(), loginConfig.getErrorPage()));
            } else if (requestedMechanism.equalsIgnoreCase(CLIENT_CERT_AUTH)) {
                authenticationMechanisms.add(new ClientCertAuthenticationMechanism(CLIENT_CERT_AUTH));
View Full Code Here

        //TODO: we need a way of specifying fine grained login constrains
        handler = new AuthenticationCallHandler(handler);
        handler = new AuthenticationConstraintHandler(handler);
        final List<AuthenticationMechanism> mechanisms = new ArrayList<AuthenticationMechanism>();
        if (config.basic) {
            mechanisms.add(new BasicAuthenticationMechanism(config.realmName));
        }
        if (config.kerberos) {
            mechanisms.add(new GSSAPIAuthenticationMechanism(config.subjectFactory));
        }
        if (config.form) {
View Full Code Here

    private static HttpHandler addSecurity(final HttpHandler toWrap, final IdentityManager identityManager) {
        HttpHandler handler = toWrap;
        handler = new AuthenticationCallHandler(handler);
        handler = new AuthenticationConstraintHandler(handler);
        final List<AuthenticationMechanism> mechanisms = Collections.<AuthenticationMechanism>singletonList(new BasicAuthenticationMechanism("My Realm"));
        handler = new AuthenticationMechanismsHandler(handler, mechanisms);
        handler = new SecurityInitialHandler(AuthenticationMode.PRO_ACTIVE, identityManager, handler);
        return handler;
    }
View Full Code Here

    private static HttpHandler addSecurity(final HttpHandler toWrap, final IdentityManager identityManager) {
        HttpHandler handler = toWrap;
        handler = new AuthenticationCallHandler(handler);
        handler = new AuthenticationConstraintHandler(handler);
        final List<AuthenticationMechanism> mechanisms = Collections.<AuthenticationMechanism>singletonList(new BasicAuthenticationMechanism("My Realm"));
        handler = new AuthenticationMechanismsHandler(handler, mechanisms);
        handler = new SecurityInitialHandler(AuthenticationMode.PRO_ACTIVE, identityManager, handler);
        return handler;
    }
View Full Code Here

        current = new AuthenticationCallHandler(current);
        current = new AuthenticationConstraintHandler(current);

        List<AuthenticationMechanism> mechs = new ArrayList<AuthenticationMechanism>();
        mechs.add(sso);
        mechs.add(new BasicAuthenticationMechanism("Test Realm"));

        current = new AuthenticationMechanismsHandler(current, mechs);
        current = new NotificationReceiverHandler(current, Collections.<NotificationReceiver>singleton(auditReceiver));

        current = new SecurityInitialHandler(AuthenticationMode.PRO_ACTIVE, identityManager, current);
View Full Code Here

*/
@RunWith(DefaultServer.class)
public class BasicAuthenticationTestCase extends AuthenticationTestBase {

    static AuthenticationMechanism getTestMechanism() {
        return new BasicAuthenticationMechanism("Test Realm");
    }
View Full Code Here

    private static HttpHandler addSecurity(final HttpHandler toWrap, final IdentityManager identityManager) {
        HttpHandler handler = toWrap;
        handler = new AuthenticationCallHandler(handler);
        handler = new AuthenticationConstraintHandler(handler);
        final List<AuthenticationMechanism> mechanisms = Collections.<AuthenticationMechanism>singletonList(new BasicAuthenticationMechanism("My Realm"));
        handler = new AuthenticationMechanismsHandler(handler, mechanisms);
        handler = new SecurityInitialHandler(AuthenticationMode.PRO_ACTIVE, identityManager, handler);
        return handler;
    }
View Full Code Here

    }
  }   

  private static HttpHandler addSecurity(final HttpHandler toWrap, IdentityManager identityManager) {   
    List<AuthenticationMechanism> mechanisms =
        Collections.<AuthenticationMechanism> singletonList(new BasicAuthenticationMechanism("Syncany"));

    HttpHandler handler = toWrap;

    handler = new AuthenticationCallHandler(handler);
    handler = new AuthenticationConstraintHandler(handler);   
View Full Code Here

TOP

Related Classes of io.undertow.security.impl.BasicAuthenticationMechanism

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.