사용자 bean 에 ip 담기 변경
This commit is contained in:
@@ -60,7 +60,7 @@ public class CustomAuthenticationProvider implements AuthenticationProvider {
|
|||||||
|
|
||||||
// front에서 전달한 사용자 ip 등록
|
// front에서 전달한 사용자 ip 등록
|
||||||
HttpServletRequest req = (attr != null) ? attr.getRequest() : null;
|
HttpServletRequest req = (attr != null) ? attr.getRequest() : null;
|
||||||
String ip = (req != null) ? HeaderUtil.get(req, "kamco-user-ip") : null;
|
String ip = (req != null) ? HeaderUtil.get(req, "X-Forwarded-For") : null;
|
||||||
|
|
||||||
UsernamePasswordAuthenticationToken token =
|
UsernamePasswordAuthenticationToken token =
|
||||||
new UsernamePasswordAuthenticationToken(userDetails, null, userDetails.getAuthorities());
|
new UsernamePasswordAuthenticationToken(userDetails, null, userDetails.getAuthorities());
|
||||||
|
|||||||
@@ -39,7 +39,6 @@ public class ApiLogFunction {
|
|||||||
|
|
||||||
public static String getXFowardedForIp(HttpServletRequest request) {
|
public static String getXFowardedForIp(HttpServletRequest request) {
|
||||||
String ip = request.getHeader("X-Forwarded-For");
|
String ip = request.getHeader("X-Forwarded-For");
|
||||||
log.info("HEADER [x-forwarded-for] = {}", ip);
|
|
||||||
if (ip != null) {
|
if (ip != null) {
|
||||||
ip = ip.split(",")[0].trim();
|
ip = ip.split(",")[0].trim();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -74,7 +74,6 @@ public class ApiResponseAdvice implements ResponseBodyAdvice<Object> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
String ip = ApiLogFunction.getXFowardedForIp(servletRequest);
|
String ip = ApiLogFunction.getXFowardedForIp(servletRequest);
|
||||||
// String ip = HeaderUtil.get(servletRequest, "kamco-user-ip");
|
|
||||||
Long userid = null;
|
Long userid = null;
|
||||||
String loginAttemptId = null;
|
String loginAttemptId = null;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user