Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

189
Views
Difference between AuthenticationManagerBuilder and HttpSecurity.authenticationProvider

To provide a custom authentication provider in spring boot, do I need both of the following? and what is their difference?

AuthenticationManagerBuilder

HttpSecurity.authenticationProvider(...)

@Configuration
@EnableWebSecurity
public class SecurityConfig extends WebSecurityConfigurerAdapter{

  @Autowired
  private MyAuthenticationProvider myAuthenticationProvider;

  @Autowired
  @Override
  protected void configure(AuthenticationManagerBuilder auth) throws Exception {
      auth.authenticationProvider(myAuthenticationProvider);
  }

  // --------------- OR/AND ? ----------------
  @Override
  protected void configure(HttpSecurity http) throws Exception {
      http
      .authenticationProvider(myAuthenticationProvider)
      // ...
  }
}
about 4 years ago · Santiago Trujillo
1 answers
Answer question

0

You only need to use one of the two options. Internally, http.authenticationProvider is just making a call to AuthenticationManagerBuilder.authenticationProvider.

about 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!