스프링부트 버전 2.7이상 authenticationManagerBean 등록방법을 잘 모르겠습니다.
안녕하세요 선생님 일단 좋은 강의 감사합니다.
선생님 강의를 들으면서 2.7버전으로 진행하고 있는데
매니저 를 등록할때부터 막혔습니다.
제 나름대로 소스도 좀 제가 평소에 하던 방식으로 하고있었는데 강의 버전이랑 맞지 않으니 힘드네요 ㅠ 이 부분은 스프링부트 2.7이상에서는 어떻게 하면될까요?
깃허브 주소 : https://github.com/PeachCoolPiece/corespringsecurity
입니다.
답변 1
0
네
@Bean
public AuthenticationManager authenticationManager(AuthenticationConfiguration authenticationConfiguration) throws Exception {
ProviderManager authenticationManager = (ProviderManager)authenticationConfiguration.getAuthenticationManager();
return authenticationManager;
}
이렇게 해 보시기 바랍니다.
0
답변 감사합니다 선생님 그러면 setAuthenticationManager를 해줄때 new AuthenticationConfiguration() 이런식으로 해보고있는데 안되서 헤매고 있네요 ㅠㅠ..
0
네
@Bean
public AjaxLoginProcessingFilter ajaxLoginProcessingFilter() throws Exception {
AjaxLoginProcessingFilter ajaxLoginProcessingFilter = new AjaxLoginProcessingFilter();
ajaxLoginProcessingFilter.setAuthenticationManager(authenticationManager());
return ajaxLoginProcessingFilter;
@Bean
public AuthenticationManager authenticationManager () throws Exception {
return authenticationConfiguration.getAuthenticationManager);
으로 하시면 됩니다
다만 설정에 따라 어떤 환경에서는 다른 결과가 나오기도 하는데 흐름에 이상이 없다면 그렇게 하시면 될 것 같습니다
시큐리티 공부 버전 질문
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
332
1
소스 부분 질문 드립니다.
0
208
2
섹션4 7번 강의 문제가 있는거 같네요.
0
344
2
파일이 수시로 이름이 바껴있네요 ㄷㄷ
0
304
1
HttpSessionSecurityContextRepository를 사용안하는 문제
0
555
2
error , exception 이 잘 안됩니다.
0
282
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
430
2
403 에러 뜹니다.
0
813
2
login_proc의 존재에 대한 간략한 설명입니다
0
276
1
top.html에 로그인 링크를 만들어서 로그인을 해봤습니다
0
283
2
안녕하세요. DB에 저장될 때 이해 안 가는 값이 있어서 질문드립니다!
0
189
1






선생님 하다보니깐 authenticationConfiguration을 생성자 주입으로 받고 이런식으로 했는데 실행은 되는데 이런식으로 해도 상관없을가요?