inflearn logo
강의

강의

N
챌린지

챌린지

멘토링

멘토링

N
클립

클립

로드맵

로드맵

지식공유

스프링 시큐리티

4) 인증 핸들러 - AjaxAuthenticationSuccessHandler, AjaxAuthenticationFailureHandler

핸들러 singleton Exception이 발생합니다

6830

이한솔

작성한 질문수 16

0

ajaxAuthenticationSuccessHandler
ajaxAuthenticationFailureHandler

이번 강의에 새로 배운 핸들러를 등록하고 구동하려 하니

이전 SecurityContext에서 @Autowired했던 
formAuthenticationSuccessHandler()와 충돌이 납니다.

아래는 에러 내용입니다. 

물론, @Qualifier를 해주니 에러는 안생기지만 강사님이

강의하신 내용이나 git전체소스를 봐도 @Qualifer를 해주는 부분은 없습니다. 어떻게 해야할까요?

========에러 내용=================

Exception in thread "task-2" org.springframework.beans.factory.BeanCreationNotAllowedException: Error creating bean with name 'delegatingApplicationListener': Singleton bean creation not allowed while singletons of this factory are in destruction (Do not request a bean from a BeanFactory in a destroy method implementation!)

Spring Security java spring-boot

답변 6

0

이한솔

감사합니다. 해결되었습니다!

0

정수원

@Qualifier("customAuthenticationSuccesshandler")
@Autowired
private AuthenticationSuccessHandler formAuthenticationSuccessHandler;

@Qualifier("customAuthenticationFailurehandler")
@Autowired
private AuthenticationFailureHandler formAuthenticationFailureHandler;

을 아래와 같이 변경해 보시기 바랍니다.

AuthenticationSuccessHandler 인터페이스 타입을 사용하는 경우에는 타입 충돌이 발생하지 않도록

클래스이름의 변수명을 적어 주셔야 합니다.

@Autowired
private AuthenticationSuccessHandler customAuthenticationSuccesshandler;

@Autowired
private AuthenticationFailureHandler customAuthenticationFailurehandler;

0

이한솔

SecurityApplication 만 있는것은 master 브랜치고 `ajax_인증인가처리` 브랜치 보시면 코드 확인 가능하실것입니다 ㅠ

0

정수원

위 github 에는 관련 소스 파일이 존재 하지 않는 것 같습니다.

SecurityApplication 파일만 보입니다.

확인 부탁드립니다.

0

이한솔

https://github.com/catsbi/spring-security-lecture.git

깃소스입니다. 여기서 브랜치중 ajax_인증인가처리 부분입니다. ㅠㅠ 

0

정수원

음..

해당 오류 내용만 봐서는 어디 지점에서 발생하는 것인지 정확한 원인을 알기 힘드네요

가능하시다면 오류와 관련된 파일 전체 소스들을 볼 수 있을까요?

시큐리티 공부 버전 질문

0

175

1

[해결 방법] MethodSecurityConfig.customMethodSecurityMetadataSource() 호출하지 않는 이슈

0

186

1

AbstractSecurityInterceptor.class.beforeInvocation()를 2번 실행하는 경우

0

174

1

강의 코드가 왜이렇게 뒤죽박죽인가요...

0

249

1

메인 페이지로 접속해도 login url로 리다이렉트가 되지 않습니다..

0

236

1

파라미터값이 넘어가지 않습니다 ....

0

374

1

security filterChain 설정 질문이 있습니다.

0

331

1

소스 부분 질문 드립니다.

0

208

2

섹션4 7번 강의 문제가 있는거 같네요.

0

344

2

파일이 수시로 이름이 바껴있네요 ㄷㄷ

0

304

1

HttpSessionSecurityContextRepository를 사용안하는 문제

0

555

2

error , exception 이 잘 안됩니다.

0

280

2

thymeleaf tag 질문합니다.

0

196

2

버전업하면서 deprecated된 것들이 너무많아요

0

478

1

spring security 패치 관련

0

437

1

모바일을 사용할때 토큰말고 세션

0

846

2

DB 연동한 인가 부분에 대한 질문입니다!

0

264

1

Ajax방식도 똑같이 Session방식을 사용하는건가요?

0

307

1

Config 파일 생성 시 질문이 있습니다.

0

225

1

강사님 몇일동안 구글 검색만 100개 했는데도 이유를 모르겠습니다..

1

429

2

403 에러 뜹니다.

0

813

2

login_proc의 존재에 대한 간략한 설명입니다

0

276

1

top.html에 로그인 링크를 만들어서 로그인을 해봤습니다

0

282

2

안녕하세요. DB에 저장될 때 이해 안 가는 값이 있어서 질문드립니다!

0

189

1