沈斌
2018-02-02 e60f6e849f43cb894fb96646de71304cf2524827
src/main/java/com/moral/security/auth/login/LoginProcessingFilter.java
@@ -54,15 +54,12 @@
            }
            throw new AuthMethodNotSupportedException("Authentication method not supported");
        }
        LoginRequest loginRequest = objectMapper.readValue(request.getReader(), LoginRequest.class);
        if (StringUtils.isBlank(loginRequest.getUsername())
                || StringUtils.isBlank(loginRequest.getPassword())
                || loginRequest.getMode() == null) {
            throw new AuthenticationServiceException("Username or Password not provided");
        }
        UsernamePasswordAuthenticationToken token = new UsernamePasswordAuthenticationToken(loginRequest.getUsername(), loginRequest.getPassword());
        // 此处存储登录方式由客户端发送过来
        token.setDetails(loginRequest.getMode());