title: How to update deprecated WebSecurityConfigurerAdapter with userDetailsService in Spring Boot 2.7
body: <p>WebSecurityConfigurerAdapter in Spring 2.7 is depricated.
  How should I update this class:</p>
  <pre><code>public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
  
      private final UserRepository userRepository;
  
      @Autowired
      public void configureGlobal(AuthenticationManagerBuilder auth) throws Exception {
          auth.userDetailsService(
                  email -&gt; {
                      log.debug(&quot;Authenticating '{}'&quot;, email);
                      Optional&lt;User&gt; optionalUser = userRepository.findByEmailIgnoreCase(email);
                      return new AuthUser(optionalUser.orElseThrow(
                              () -&gt; new UsernameNotFoundException(&quot;User '&quot; + email + &quot;' was not found&quot;)));
                  }
          ).passwordEncoder(PasswordEncoderFactories.createDelegatingPasswordEncoder());
      }
  
      @Override
      protected void configure(HttpSecurity http) throws Exception {
          http.authorizeRequests()....
      }
  }
  </code></pre>