Java Code Examples for org.springframework.security.web.authentication.preauth.PreAuthenticatedAuthenticationProvider#setPreAuthenticatedUserDetailsService()

The following examples show how to use org.springframework.security.web.authentication.preauth.PreAuthenticatedAuthenticationProvider#setPreAuthenticatedUserDetailsService() . These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
private void addUserDetailsService(CustomTokenService tokenServices, UserDetailsService userDetailsService) {
    if (userDetailsService != null) {
        PreAuthenticatedAuthenticationProvider provider = new PreAuthenticatedAuthenticationProvider();
        provider.setPreAuthenticatedUserDetailsService(new UserDetailsByNameServiceWrapper<>(
                userDetailsService));
        tokenServices.setAuthenticationManager(new ProviderManager(Arrays.asList(provider)));
    }
}
 
Example 2
Source Project: inception   File: InceptionSecurity.java    License: Apache License 2.0 5 votes vote down vote up
@Bean(name = "authenticationProvider")
@Profile("auto-mode-preauth")
public PreAuthenticatedAuthenticationProvider externalAuthenticationProvider()
{
    PreAuthenticatedAuthenticationProvider authProvider = 
            new PreAuthenticatedAuthenticationProvider();
    authProvider.setPreAuthenticatedUserDetailsService(
            new UserDetailsByNameServiceWrapper<PreAuthenticatedAuthenticationToken>(
                    userDetailsService()));
    return authProvider;
}
 
Example 3
Source Project: herd   File: AppSpringModuleConfig.java    License: Apache License 2.0 5 votes vote down vote up
@Bean
@Override
public AuthenticationManager authenticationManager()
{
    PreAuthenticatedAuthenticationProvider authenticationProvider = new PreAuthenticatedAuthenticationProvider();
    authenticationProvider.setPreAuthenticatedUserDetailsService(herdUserDetailsService);
    List<AuthenticationProvider> providers = new ArrayList<>();
    providers.add(authenticationProvider);
    return new ProviderManager(providers);
}
 
Example 4
Source Project: webanno   File: WebAnnoSecurity.java    License: Apache License 2.0 5 votes vote down vote up
@Bean(name = "authenticationProvider")
@Profile("auto-mode-preauth")
public PreAuthenticatedAuthenticationProvider externalAuthenticationProvider()
{
    PreAuthenticatedAuthenticationProvider authProvider = 
            new PreAuthenticatedAuthenticationProvider();
    authProvider.setPreAuthenticatedUserDetailsService(
            new UserDetailsByNameServiceWrapper<PreAuthenticatedAuthenticationToken>(
                    userDetailsService()));
    return authProvider;
}
 
Example 5
Source Project: bearchoke   File: SecurityConfig.java    License: Apache License 2.0 5 votes vote down vote up
@Bean(name = "preAuthAuthenticationManager")
public AuthenticationManager preAuthAuthenticationManager() {
    PreAuthenticatedAuthenticationProvider preAuthProvider = new PreAuthenticatedAuthenticationProvider();
    preAuthProvider.setPreAuthenticatedUserDetailsService(preAuthUserDetailsService);

    List<AuthenticationProvider> providers = new ArrayList<AuthenticationProvider>();
    providers.add(preAuthProvider);

    return new ProviderManager(providers);
}
 
Example 6
Source Project: bearchoke   File: MockServerConfig.java    License: Apache License 2.0 5 votes vote down vote up
@Bean(name = "preAuthAuthenticationManager")
public AuthenticationManager preAuthAuthenticationManager() {
    PreAuthenticatedAuthenticationProvider preAuthProvider = new PreAuthenticatedAuthenticationProvider();
    preAuthProvider.setPreAuthenticatedUserDetailsService(preAuthUserDetailsService());

    return new ProviderManager(Arrays.asList(preAuthProvider));
}
 
Example 7
private void addUserDetailsService(YamiTokenServices tokenServices) {
    PreAuthenticatedAuthenticationProvider provider = new PreAuthenticatedAuthenticationProvider();
    provider.setPreAuthenticatedUserDetailsService(new UserDetailsByNameServiceWrapper<>(userDetailsService));
    tokenServices.setAuthenticationManager(new ProviderManager(Collections.singletonList(provider)));
}
 
Example 8
Source Project: syndesis   File: SecurityConfiguration.java    License: Apache License 2.0 4 votes vote down vote up
private static AuthenticationProvider authenticationProvider() {
    PreAuthenticatedAuthenticationProvider authProvider = new PreAuthenticatedAuthenticationProvider();
    authProvider.setPreAuthenticatedUserDetailsService(new PreAuthenticatedGrantedAuthoritiesUserDetailsService());
    return authProvider;
}
 
Example 9
Source Project: todolist   File: WebSecurityConfiguration.java    License: MIT License 4 votes vote down vote up
@Bean
PreAuthenticatedAuthenticationProvider preAuthenticationProvider() {
	PreAuthenticatedAuthenticationProvider provider = new PreAuthenticatedAuthenticationProvider();
	provider.setPreAuthenticatedUserDetailsService(apiDetailsService());
	return provider;
}
 
Example 10
Source Project: training   File: WebSecurityConfig.java    License: MIT License 4 votes vote down vote up
@Bean
public AuthenticationProvider preAuthenticatedProvider() {
    PreAuthenticatedAuthenticationProvider provider = new PreAuthenticatedAuthenticationProvider();
    provider.setPreAuthenticatedUserDetailsService(preauthUserDetailsService());
    return provider;
}
 
Example 11
Source Project: cloudbreak   File: SecurityConfig.java    License: Apache License 2.0 4 votes vote down vote up
@Bean
public PreAuthenticatedAuthenticationProvider preAuthAuthProvider() throws Exception {
    PreAuthenticatedAuthenticationProvider provider = new PreAuthenticatedAuthenticationProvider();
    provider.setPreAuthenticatedUserDetailsService(userDetailsServiceWrapper());
    return provider;
}
 
Example 12
Source Project: cloudbreak   File: SecurityConfig.java    License: Apache License 2.0 4 votes vote down vote up
@Bean
public PreAuthenticatedAuthenticationProvider preAuthAuthProvider() throws Exception {
    PreAuthenticatedAuthenticationProvider provider = new PreAuthenticatedAuthenticationProvider();
    provider.setPreAuthenticatedUserDetailsService(userDetailsServiceWrapper());
    return provider;
}