Example usage for org.springframework.security.authentication ProviderManager ProviderManager

List of usage examples for org.springframework.security.authentication ProviderManager ProviderManager

Introduction

In this page you can find the example usage for org.springframework.security.authentication ProviderManager ProviderManager.

Prototype

ProviderManager

Source Link

Usage

From source file:org.apache.wicket.security.examples.springsecurity.SpringSecureWicketTestApplication.java

@Override
public void init() {
    ApplicationContextMock appctx = new ApplicationContextMock();

    // Make injection of spring beans in wicket-related classes possible using
    // @SpringBean.
    addComponentInstantiationListener(new SpringComponentInjector(this, appctx, true));

    ProviderManager authMan = new ProviderManager();
    List<TestingAuthenticationProvider> providerList = new ArrayList<TestingAuthenticationProvider>();
    providerList.add(new TestingAuthenticationProvider());
    authMan.setProviders(providerList);//from ww w.jav  a2 s  . c  o  m

    // appctx.putBean("testAuthenticationProvider", authProvider);
    // appctx.putBean("authenticationManager", authMan);
    this.authenticationManager = authMan;

    this.setupStrategyFactory();
    this.setupActionFactory();

    this.setUpHive(); // this one should be called automatically ?
    // Wicket markup setting.
    getMarkupSettings().setStripComments(false);
    getMarkupSettings().setStripWicketTags(false);
    getMarkupSettings().setDefaultBeforeDisabledLink("");
    getMarkupSettings().setDefaultAfterDisabledLink("");
}

From source file:ch.astina.hesperid.web.services.SecurityModule.java

/**
 * Iterates an <code>Authentication</code> request through a list of
 * <code>AuthenticationProvider</code>s.
 *///from  w w  w. ja v a  2  s  .  co  m
@Marker(SpringSecurityServices.class)
public static AuthenticationManager buildProviderManager(final List<AuthenticationProvider> providers)
        throws Exception {
    ProviderManager manager = new ProviderManager();
    manager.setProviders(providers);
    manager.afterPropertiesSet();
    return manager;
}