WebAuthenticationDetailsSource 是做什么的?
What does WebAuthenticationDetailsSource?
我正在尝试找出其他人的 spring 安全代码。我想找出这行代码的作用,一般来说,这个特定的 class。它在文档中描述得非常简短和难以理解。
authentication.setDetails(new WebAuthenticationDetailsSource().buildDetails(request));
正如您在 source code 中所见,class 本身 非常 简单。
它的唯一职责是将 HttpServletRequest
class 的实例转换为 WebAuthenticationDetails
class 的实例。您可以将其视为一个简单的转换器。
HttpServletRequest
对象表示已解析的 raw HTTP 数据并且是标准 Java class 是输入。 WebAuthenticationDetails
是一个内部 Spring class.
因此,您可以将其视为servlet classes和Spring classes之间的桥梁。
HttpServletRequest
是古class。一直回到 Java 6. (link). And the other one comes from Spring. (link)
我正在尝试找出其他人的 spring 安全代码。我想找出这行代码的作用,一般来说,这个特定的 class。它在文档中描述得非常简短和难以理解。
authentication.setDetails(new WebAuthenticationDetailsSource().buildDetails(request));
正如您在 source code 中所见,class 本身 非常 简单。
它的唯一职责是将 HttpServletRequest
class 的实例转换为 WebAuthenticationDetails
class 的实例。您可以将其视为一个简单的转换器。
HttpServletRequest
对象表示已解析的 raw HTTP 数据并且是标准 Java class 是输入。 WebAuthenticationDetails
是一个内部 Spring class.
因此,您可以将其视为servlet classes和Spring classes之间的桥梁。
HttpServletRequest
是古class。一直回到 Java 6. (link). And the other one comes from Spring. (link)