class PrincipalContext
cangjie
public abstract class PrincipalContext<TOptions> <: PropertiesContext<TOptions> where TOptions <: AuthenticationSchemeOptions功能:提供包含用户主体的身份验证上下文基类。
父类型:
- PropertiesContext<TOptions>
成员概览
| 成员 | 功能 |
|---|---|
| init(HttpContext, AuthenticationScheme, TOptions, ?AuthenticationProperties) | 创建一个带用户主体的上下文基类实例。 |
| var principal | 保存当前上下文的用户主体。 |
init(HttpContext, AuthenticationScheme, TOptions, ?AuthenticationProperties)
cangjie
protected init(context: HttpContext, scheme: AuthenticationScheme, options: TOptions,
properties: ?AuthenticationProperties)功能:创建一个带用户主体的上下文基类实例。
参数:
- context: HttpContext - 当前 HTTP 上下文。
- scheme: AuthenticationScheme - 当前身份验证方案。
- options:
TOptions- 当前方案选项。 - properties: ?AuthenticationProperties - 身份验证属性。
var principal
cangjie
public var principal: ?ClaimsPrincipal = None功能:保存当前上下文的用户主体。
类型:?ClaimsPrincipal