작업 상태

- spring boot 3.x 에서 스프링시큐리티로 로그인 작업을 하던중 에러가 발생함

 

에러 메시지

'org.springframework.security.authentication.AuthenticationManager' that could not be found.

 

원인

스프링 부트 3에 오면서 AuthenticationManager 설정 방법이 달라짐

 

처리

@Configuration
public class SecurityConfig {
 ...
   
   @Bean
    public AuthenticationManager authenticationManager(AuthenticationConfiguration authenticationConfiguration)
            throws Exception {
        return authenticationConfiguration.getAuthenticationManager();
    }

특이 사항 없음:

참조:

java - Springboot 3.0.0-M2 AuthenticationManager - Stack Overflow

 

Springboot 3.0.0-M2 AuthenticationManager

I wanted to create a backend using spring boot. When I executed the application, this exception was thrown: Field authenticationManager in projekt.controller.AuthController required a bean of type...

stackoverflow.com

Servlet Authentication Architecture :: Spring Security

 

Servlet Authentication Architecture :: Spring Security

ProviderManager is the most commonly used implementation of AuthenticationManager. ProviderManager delegates to a List of AuthenticationProvider instances. Each AuthenticationProvider has an opportunity to indicate that authentication should be successful,

docs.spring.io

 

AuthenticationManager는 Spring Security에서 인증(authentication)을 처리하는 인터페이스입니다. 
AuthenticationManager는 인증 처리를 위해 Authentication 객체를 받아 인증을 시도합니다.
인증이 성공하면 인증된 Authentication 객체를 반환하고, 
인증이 실패하면 AuthenticationException을 던집니다.

프론트 앤드 적응중 나오는 간단한 에러를 처리하는 내용을 작성할 예정인 카테고리입니다.

+ Recent posts