inflearn logo
강의

강의

N
챌린지

챌린지

멘토링

멘토링

N
클립

클립

로드맵

로드맵

지식공유

스프링 시큐리티 완전 정복 [6.x 개정판]

인증 관리자 - AuthenticationManager - 1

AuthenticationManager 사용 방법­ HttpSecurity 사용

167

bae jewoo

작성한 질문수 20

0

AuthenticationManager 사용 방법­ HttpSecurity 사용에서

@Bean 사용으로 CustomFilter를 빈으로 생성하면 안되는 이유가
AutenticationManager가 빈이 아니기 때문에 주입받지 못한다고 하셨는데

securityFilterChain(HttpSecurity http)
메서드에서
AuthenticationManagerBuilder를 통해
build() or getObject()사용으로
AuthenticationManager를 가져오고

.addFilterBefore(customFilter(autenticationManager))

여기서 넘겨주면 파라미터로 AuthenticationManagerf를 받는게 아닌가요?


spring spring-boot spring-security security web-security

답변 2

0

정수원

물론 그런 방법도 존재하긴 합니다.

다만 그렇게 했을 경우 여러 ProviderManager 의 객체들 중에 httpSecurity 가 사용하는 객체가 무엇인지를 정확하게 판별하고 사용해야 합니다.

https://www.inflearn.com/community/questions/1386189/authenticationmanager%EC%9D%98-httpsecurity-%EC%82%AC%EC%9A%A9-%EB%B6%80%EB%B6%84%EC%97%90-%EC%A7%88%EB%AC%B8-%EC%9E%88%EC%8A%B5%EB%8B%88%EB%8B%A4

0

인프런 AI 인턴

안녕하세요, 인프런 AI 인턴입니다.

bae jewoo님께서 질문 주신 내용을 기반으로 관련된 답변을 찾았습니다.

AuthenticationManager와 CustomFilter 관련 질문

AuthenticationManager를 사용하여 CustomFilter를 초기화하는 두 가지 방식(HttpSecurity 사용과 직접 생성)의 차이점과 Spring Security 버전에 따른 권장 방식을 설명한 기존 답변들을 아래 링크에서 확인하실 수 있습니다:

  1. 프로그래밍 강의 질문 - AuthenticationManager 사용방법에 대해 질문있습니다

    • 첫번째 방법(HttpSecurity 사용)과 두번째 방법(직접 생성)의 차이를 설명합니다.
    • 이 두가지 방법의 차이와 Spring Security에서 권장하는 방식을 다룹니다.
  2. 프로그래밍 강의 질문 - AuthenticationManger - HttpSecurity 사용

    • HttpSecurity 사용과 직접 생성의 차이점을 상세히 설명한 답변입니다.
    • CustomAuthenticationFilter와 FormLoginConfigurer 설정 방법을 다루고 있습니다.
  3. 프로그래밍 강의 질문 - AuthenticationManager

    • AuthenticationManager를 Bean으로 만드는 방법과 HttpSecurity를 사용하는 방법에 대해 설명합니다.
    • Spring Security 5.7 이후 버전에서 WebSecurityConfigurerAdapter를 사용할 수 없는 경우의 대안 방법도 설명하고 있습니다.

저는 질문자님의 이해를 돕고자 지식공유자님의 기존 답변을 참고하여 유사한 답변 링크를 추천해드리고 있습니다.
현재 베타 기능으로 답변이 만족스럽지 않을 수 있는 점 양해 부탁드립니다. 🙏
추가적으로 궁금한 점이 있으시면, 이어서 질문해 주세요. 곧 지식공유자께서 답변해 주실 것입니다.

로그아웃-logout()-2 강에서 겟방식 로그아웃 호출 후 화면이동 질문입니다.

0

35

2

단원별 소스코드

0

64

2

CustomAuthenticationProvider 추가 관련 문의

0

77

2

AOP 의존성 명칭 변경

0

76

1

빈 1개 등록 시 다른 해결 방법

0

70

1

@Bean으로 AuthenticationProvider를 등록 시 http.authenticationProvider 함수를 이용해서 추가해줘야되나요?

0

87

2

OIDC의 id token에 담긴 데이터에 대해

0

78

1

loginPage("/loginPage") 질문드립니다.

0

69

1

@EnableWebSecurity

0

148

1

트랜잭션과 롤백

0

99

1

68. 인증 이벤트 - AuthenticationEventPublisher 활용 강좌 음성 문제

0

91

2

AuthenticationManager 사용 방법

0

153

2

HttpSecurity.authorizeHttpRequests() - 2 강의 부분에 대한 질문

0

108

2

spring security 6.3에서는 HttpSecurity가 만들어지기 전 WebSecurity가 먼저 만들어지는게 맞나요??

0

192

1

init(B Builder), configure(B builder) 에 대하여 질문 드립니다.

0

109

2

메타 주석 질문

0

69

1

동시세션제어 기능에서 로그아웃하기

0

150

3

로그인 후, redirect 에서 error

0

140

3

Session 생성 타이밍에 대한 질문

0

86

2

강의 참고 내용을 개발 로그로 작성해도 될지 문의드립니다.

0

135

2

customAuthentication 관련

0

132

2

authenticationManagerBuilder 주입받은거 vs 만든 거

0

114

1

UserDetailsService()에서 UserDetail이 아닌 타입을 반환할 수 있나요?

0

101

1

9:28 패턴 3의 경우 마지막으로 설정한 것만 적용되는 것 같습니다.

0

162

2