인프런 커뮤니티 질문&답변
ajax로 로그인 시 오류
작성
·
310
0
IpAddressVoter.java 의 public int vote(Authentication authentication, Object object, Collection<ConfigAttribute> attributes) {....} 에서
인자인 Authentication authentication 객체 안에FormWebAuthenticationDetails 객체가 null 로 IP정보를 가져오지 못합니다.
사용자 IP를 가져올 방법이 없을까요?
답변 1
0
김은식
질문자
찾았습니다.
AjaxLoginProcessingFilter.java안에서 AjaxAuthenticationToken ajaxAuthenticationToken = new AjaxAuthenticationToken(accountDto.getUsername(), accountDto.getPassword());
FormWebAuthenticationDetails formWebAuthenticationDetails = new FormWebAuthenticationDetails(request);
ajaxAuthenticationToken.setDetails(formWebAuthenticationDetails);
추가하면 되겠네요.. 강사님 github에 반영하면 좋을듯 합니다.





아 네 감사드립니다^^