• 카테고리

    질문 & 답변
  • 세부 분야

    백엔드

  • 해결 여부

    미해결

ajax로 로그인 시 오류

22.11.25 13:55 작성 조회수 203

0

IpAddressVoter.java 의 public int vote(Authentication authentication, Object object, Collection<ConfigAttribute> attributes) {....} 에서

인자인 Authentication authentication 객체 안에FormWebAuthenticationDetails 객체가 null 로 IP정보를 가져오지 못합니다.

사용자 IP를 가져올 방법이 없을까요?

답변 1

답변을 작성해보세요.

0

김은식님의 프로필

김은식

질문자

2022.11.25

찾았습니다.

AjaxLoginProcessingFilter.java안에서 AjaxAuthenticationToken ajaxAuthenticationToken = new AjaxAuthenticationToken(accountDto.getUsername(), accountDto.getPassword());

FormWebAuthenticationDetails formWebAuthenticationDetails = new FormWebAuthenticationDetails(request);

ajaxAuthenticationToken.setDetails(formWebAuthenticationDetails);

 

추가하면 되겠네요.. 강사님 github에 반영하면 좋을듯 합니다.

아 네 감사드립니다^^