public class WebAuthenticationDetails extends Object implements Serializable
临时将 WebAuthenticationDetails 拷贝出来,用于解决自定义 WebAuthenticationDetails 无法反序列化问题。
1. 主要原因是 WebAuthenticationDetails 开放的构造函数是以 HttpServletRequest 作为参数,难以对该参数进行构造 2. 而以 remoteAddress, sessionId 作为参数的构造函数,又被设置为 private,不能使用。
该问题已经在 spring security 5.7 版本解决,但是不知道什么时候发布,所以先临时改一下。
| 构造器和说明 |
|---|
WebAuthenticationDetails(javax.servlet.http.HttpServletRequest request)
Records the remote address and will also set the session Id if a session already
exists (it won't create one).
|
WebAuthenticationDetails(String remoteAddress,
String sessionId)
Constructor to add Jackson2 serialize/deserialize support
|
public WebAuthenticationDetails(javax.servlet.http.HttpServletRequest request)
request - that the authentication request was received fromCopyright © 2022. All rights reserved.