JwtSecurityTokenHandler 类
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
专为 SecurityTokenHandler 创建和验证 Json Web 令牌而设计。 请参阅: https://datatracker.ietf.org/doc/html/rfc7519 和 http://www.rfc-editor.org/info/rfc7515
public class JwtSecurityTokenHandler : Microsoft.IdentityModel.Tokens.SecurityTokenHandler
type JwtSecurityTokenHandler = class
inherit SecurityTokenHandler
Public Class JwtSecurityTokenHandler
Inherits SecurityTokenHandler
- 继承
构造函数
| 名称 | 说明 |
|---|---|
| JwtSecurityTokenHandler() |
初始化 JwtSecurityTokenHandler 类的新实例。 |
字段
| 名称 | 说明 |
|---|---|
| DefaultInboundClaimFilter |
默认声明类型筛选器列表。 |
| DefaultInboundClaimTypeMap |
入站声明的默认声明类型映射。 |
| DefaultMapInboundClaims |
确定是否使用 InboundClaimTypeMap 的标志的默认值。 |
| DefaultOutboundAlgorithmMap |
默认 JwtHeader 算法映射 |
| DefaultOutboundClaimTypeMap |
出站声明的默认声明类型映射。 |
属性
| 名称 | 说明 |
|---|---|
| CanValidateToken |
返回一个值,该值指示此处理程序是否可以验证 。SecurityToken |
| CanWriteToken |
获取一个 SecurityToken值,该值指示此实例是否可以写入 。 |
| InboundClaimFilter |
获取或设置 ISet<T> 在填充 ClaimsIdentity 声明时 JwtSecurityToken筛选声明的用法。
验证后,不会向 < 默认值为 ClaimTypeMapping.InboundClaimFilter。 |
| InboundClaimTypeMap |
获取或设置InboundClaimTypeMap在验证 a Type时为提取的ClaimsPrincipal声明设置JwtSecurityToken时使用的项。 使用此映射进行转换后,该 Type 属性将设置为 JSON 声明“name”。 默认值为 ClaimTypeMapping.InboundClaimTypeMap。 |
| JsonClaimTypeProperty |
获取或设置将值序列化为 JSON 时Claims识别的 Properties .Net 类型的属性名称。 有关详细信息,请参阅 <seealso cref=“P:System.IdentityModel.Tokens.JwtSecurityTokenHandler.InboundClaimTypeMap”></seealso> 。 |
| MapInboundClaims |
获取或设置在 MapInboundClaims 确定是否映射验证 a JwtSecurityToken时提取的声明类型时使用的属性。 如果此值设置为 true, Type 则使用此映射进行转换后,将设置为 JSON 声明“name”。 否则,不会发生映射。 默认值为真。 |
| MaximumTokenSizeInBytes |
获取和设置将处理的最大令牌大小(以字节为单位)。 (继承自 TokenHandler) |
| OutboundAlgorithmMap |
获取传递给构造函数的 JwtHeader 出站算法映射。 |
| OutboundClaimTypeMap |
获取或设置OutboundClaimTypeMap从 Claim(s) 创建JwtSecurityToken时使用的项。 使用此映射进行转换后,JSON 声明“name”值设置为 Type 。 默认值为 ClaimTypeMapping.OutboundClaimTypeMap |
| SetDefaultTimesOnTokenCreation |
获取或设置一个布尔值,用于控制令牌创建是否将设置默认的“exp”、“nbf”和“iat”(如果未指定)。 (继承自 TokenHandler) |
| ShortClaimTypeProperty |
获取或设置在创建 时发生映射时Properties,将包含原始 JSON 声明“name”的属性名称Claim。 有关详细信息,请参阅 <seealso cref=“P:System.IdentityModel.Tokens.JwtSecurityTokenHandler.InboundClaimTypeMap”></seealso> 。 |
| TokenLifetimeInMinutes |
获取或设置令牌生存期(以分钟为单位)。 (继承自 TokenHandler) |
| TokenType |
获取 JwtSecurityToken的类型。 |