use of org.springframework.security.web.authentication.preauth.PreAuthenticatedAuthenticationProvider in project spring-security by spring-projects.
the class JeeConfigurer method init.
/**
* Populates a {@link PreAuthenticatedAuthenticationProvider} into
* {@link HttpSecurity#authenticationProvider(org.springframework.security.authentication.AuthenticationProvider)}
* and a {@link Http403ForbiddenEntryPoint} into
* {@link HttpSecurityBuilder#setSharedObject(Class, Object)}
*
* @see org.springframework.security.config.annotation.SecurityConfigurerAdapter#init(org.springframework.security.config.annotation.SecurityBuilder)
*/
@Override
public void init(H http) {
PreAuthenticatedAuthenticationProvider authenticationProvider = new PreAuthenticatedAuthenticationProvider();
authenticationProvider.setPreAuthenticatedUserDetailsService(getUserDetailsService());
authenticationProvider = postProcess(authenticationProvider);
http.authenticationProvider(authenticationProvider).setSharedObject(AuthenticationEntryPoint.class, new Http403ForbiddenEntryPoint());
}
use of org.springframework.security.web.authentication.preauth.PreAuthenticatedAuthenticationProvider in project spring-security-oauth by spring-projects.
the class AuthorizationServerEndpointsConfigurer method addUserDetailsService.
private void addUserDetailsService(DefaultTokenServices tokenServices, UserDetailsService userDetailsService) {
if (userDetailsService != null) {
PreAuthenticatedAuthenticationProvider provider = new PreAuthenticatedAuthenticationProvider();
provider.setPreAuthenticatedUserDetailsService(new UserDetailsByNameServiceWrapper<PreAuthenticatedAuthenticationToken>(userDetailsService));
tokenServices.setAuthenticationManager(new ProviderManager(Arrays.<AuthenticationProvider>asList(provider)));
}
}
use of org.springframework.security.web.authentication.preauth.PreAuthenticatedAuthenticationProvider in project herd by FINRAOS.
the class AppSpringModuleConfig method authenticationManager.
@Bean
@Override
public AuthenticationManager authenticationManager() {
PreAuthenticatedAuthenticationProvider authenticationProvider = new PreAuthenticatedAuthenticationProvider();
authenticationProvider.setPreAuthenticatedUserDetailsService(herdUserDetailsService);
List<AuthenticationProvider> providers = new ArrayList<>();
providers.add(authenticationProvider);
return new ProviderManager(providers);
}
use of org.springframework.security.web.authentication.preauth.PreAuthenticatedAuthenticationProvider in project syndesis by syndesisio.
the class SecurityConfiguration method authenticationProvider.
private AuthenticationProvider authenticationProvider() {
PreAuthenticatedAuthenticationProvider authProvider = new PreAuthenticatedAuthenticationProvider();
authProvider.setPreAuthenticatedUserDetailsService(new PreAuthenticatedGrantedAuthoritiesUserDetailsService());
return authProvider;
}
use of org.springframework.security.web.authentication.preauth.PreAuthenticatedAuthenticationProvider in project spring-security by spring-projects.
the class X509Configurer method init.
@Override
public void init(H http) {
PreAuthenticatedAuthenticationProvider authenticationProvider = new PreAuthenticatedAuthenticationProvider();
authenticationProvider.setPreAuthenticatedUserDetailsService(getAuthenticationUserDetailsService(http));
http.authenticationProvider(authenticationProvider).setSharedObject(AuthenticationEntryPoint.class, new Http403ForbiddenEntryPoint());
}
Aggregations