| | |
| | | } |
| | | 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()); |