类 WebAuthenticationDetails
java.lang.Object
org.springframework.security.web.authentication.WebAuthenticationDetails
- 所有已实现的接口:
Serializable
A holder of selected HTTP details related to a web authentication request.
临时将 WebAuthenticationDetails 拷贝出来,用于解决自定义 WebAuthenticationDetails 无法反序列化问题。
1. 主要原因是 WebAuthenticationDetails 开放的构造函数是以 HttpServletRequest 作为参数,难以对该参数进行构造 2. 而以 remoteAddress, sessionId 作为参数的构造函数,又被设置为 private,不能使用。
该问题已经在 spring security 5.7 版本解决,但是不知道什么时候发布,所以先临时改一下。
-
构造器概要
构造器构造器说明WebAuthenticationDetails(String remoteAddress, String sessionId) Constructor to add Jackson2 serialize/deserialize supportWebAuthenticationDetails(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
public 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).- 参数:
request- that the authentication request was received from
-
WebAuthenticationDetails
Constructor to add Jackson2 serialize/deserialize support- 参数:
remoteAddress- remote address of current requestsessionId- session id
-
-
方法详细资料
-
equals
-
getRemoteAddress
Indicates the TCP/IP address the authentication request was received from.- 返回:
- the address
-
getSessionId
Indicates theHttpSessionid the authentication request was received from.- 返回:
- the session ID
-
hashCode
public int hashCode() -
toString
-