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

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

Introduction

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

Prototype

AnonymousAuthenticationProvider

Source Link

Usage

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

/**
 * Validates <code>AnonymousAuthenticationToken</code>s
 *//*from w w w  .j  a va 2 s.c o m*/
@Marker(SpringSecurityServices.class)
public final AuthenticationProvider buildAnonymousAuthenticationProvider(
        @Inject @Value("${spring-security.anonymous.key}") final String anonymousKey) throws Exception {

    AnonymousAuthenticationProvider provider = new AnonymousAuthenticationProvider();
    provider.setKey(anonymousKey);
    provider.afterPropertiesSet();
    return provider;
}

From source file:ubic.gemma.security.authentication.ManualAuthenticationServiceImpl.java

/**
 * We need to do this because normally the anonymous provider has
 *//*from ww  w .java  2 s. c om*/
@Override
public void afterPropertiesSet() {

    AnonymousAuthenticationProvider aap = new AnonymousAuthenticationProvider();
    aap.setKey(AuthenticationUtils.ANONYMOUS_AUTHENTICATION_KEY);
    aap.setMessageSource(messageSource);

    ((ProviderManager) this.authenticationManager).getProviders().add(aap);

}