ClaimsAuthenticationManager.Authenticate(String, ClaimsPrincipal) 方法

定义

在派生中重写时,将返回与 RP 应用程序的要求一致的 ClaimsPrincipal 对象。When overridden in a derived class, returns a ClaimsPrincipal object consistent with the requirements of the RP application. 默认实现未修改传入的 ClaimsPrincipalThe default implementation does not modify the incoming ClaimsPrincipal.

public:
 virtual System::Security::Claims::ClaimsPrincipal ^ Authenticate(System::String ^ resourceName, System::Security::Claims::ClaimsPrincipal ^ incomingPrincipal);
public virtual System.Security.Claims.ClaimsPrincipal Authenticate (string resourceName, System.Security.Claims.ClaimsPrincipal incomingPrincipal);
abstract member Authenticate : string * System.Security.Claims.ClaimsPrincipal -> System.Security.Claims.ClaimsPrincipal
override this.Authenticate : string * System.Security.Claims.ClaimsPrincipal -> System.Security.Claims.ClaimsPrincipal
Public Overridable Function Authenticate (resourceName As String, incomingPrincipal As ClaimsPrincipal) As ClaimsPrincipal

参数

resourceName
String

请求的资源的地址。The address of the resource that is being requested.

incomingPrincipal
ClaimsPrincipal

表示正在尝试访问资源的经过身份验证的用户的声明主体。The claims principal that represents the authenticated user that is attempting to access the resource.

返回

ClaimsPrincipal

包含 RP 应用程序所需任何修改的声明主体。A claims principal that contains any modifications necessary for the RP application. 默认实现返回未被修改的传入声明主体。The default implementation returns the incoming claims principal unmodified.

注解

Authenticate从请求处理管道调用方法,您可以在派生类中重写此方法,以便根据 RP 应用程序的策略筛选、修改或将声明注入声明主体。The Authenticate method is called from the request processing pipeline You can override this method in a derived class to filter, modify, or inject claims into the claims principal according to the policy of your RP application. 你甚至可以返回的自定义实现,具体取决于 RP 应用程序的要求 ClaimsPrincipalDepending on the requirements of the RP application, you can even return a custom implementation of ClaimsPrincipal.

适用于