类 WebAuthenticationDetails

java.lang.Object
org.springframework.security.web.authentication.WebAuthenticationDetails
所有已实现的接口:
Serializable
直接已知子类:
FormLoginWebAuthenticationDetails

public class WebAuthenticationDetails extends Object implements 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 版本解决,但是不知道什么时候发布,所以先临时改一下。

作者:
Ben Alex, Luke Taylor
另请参阅:
  • 构造器详细资料

    • 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

      public WebAuthenticationDetails(String remoteAddress, String sessionId)
      Constructor to add Jackson2 serialize/deserialize support
      参数:
      remoteAddress - remote address of current request
      sessionId - session id
  • 方法详细资料

    • equals

      public boolean equals(Object obj)
      覆盖:
      equals 在类中 Object
    • getRemoteAddress

      public String getRemoteAddress()
      Indicates the TCP/IP address the authentication request was received from.
      返回:
      the address
    • getSessionId

      public String getSessionId()
      Indicates the HttpSession id the authentication request was received from.
      返回:
      the session ID
    • hashCode

      public int hashCode()
      覆盖:
      hashCode 在类中 Object
    • toString

      public String toString()
      覆盖:
      toString 在类中 Object