I have defined one custom AuthenticationDetailsSource and I wanted to use the same for both HttpBasic Auth and FormLogin Auth. I have configured it through HttpSecurity. Looks like the FormLoginConfigurer is considering the provided custom AuthenticationDetailsSource but not the HttpBasicConfigurer(even though custom is provided, it's considering WebAuthenticationDetailsSource). Below is my java config, please let me know if I'm missing something here. Thanks!

I'm using below versions

spring-boot - 1.4.1.RELEASE spring-security-config-4.1.3.RELEASE spring-security-core-4.1.3.RELEASE spring-security-web-4.1.3.RELEASE

Please let me know if you need more details.

@Configuration
@EnableWebSecurity
@Import({CustomAuthenticationDetailsSource.class})
public class TestWebSecurityConfiguration extends WebSecurityConfigurerAdapter{

    private  CustomAuthenticationDetailsSource authenticationDetailsSource;

    public TestWebSecurityConfiguration (final
      final CustomAuthenticationDetailsSource authenticationDetailsSource) {
      this.authenticationDetailsSource = authenticationDetailsSource;
     }

   @Override
    protected void configure(HttpSecurity http) throws Exception {
      // @formatter:off
      http
          .authorizeRequests()
            .anyRequest().authenticated() 
        .and()
          .httpBasic().authenticationDetailsSource(this.authenticationDetailsSource) 
        .and()
          .formLogin()  
              authenticationDetailsSource(this.authenticationDetailsSource).permitAll()
        .and()
          .exceptionHandling() 
          .authenticationEntryPoint(authenticationEntryPoint()) 

    // @formatter:on
   }
}

@Component
public class CustomAuthenticationDetailsSource implements
    AuthenticationDetailsSource<HttpServletRequest, CustomAuthenticationDetails> {

  @Override
  public CustomAuthenticationDetails buildDetails(HttpServletRequest context) {
    return new CustomAuthenticationDetails(context);
  }

}

Comment From: eleftherias

@SreekarVanguru I realize this is an older issue, are you still experiencing this behaviour and if so could you provide a sample that reproduces it?

Comment From: spring-projects-issues

If you would like us to look at this issue, please provide the requested information. If the information is not provided within the next 7 days this issue will be closed.

Comment From: spring-projects-issues

Closing due to lack of requested feedback. If you would like us to look at this issue, please provide the requested information and we will re-open the issue.