JwtSecurityTokenHandler 類別
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
SecurityTokenHandler一個專為建立與驗證 Json Web Tokens 而設計的。 參見: 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
- 繼承
建構函式
| 名稱 | Description |
|---|---|
| JwtSecurityTokenHandler() |
初始化 JwtSecurityTokenHandler 類別的新執行個體。 |
欄位
| 名稱 | Description |
|---|---|
| DefaultInboundClaimFilter |
預設理賠類型篩選清單。 |
| DefaultInboundClaimTypeMap |
入站理賠的預設理賠類型映射。 |
| DefaultMapInboundClaims |
預設值為決定是否使用 InboundClaimTypeMap 的旗標。 |
| DefaultOutboundAlgorithmMap |
預設 JwtHeader 演算法映射 |
| DefaultOutboundClaimTypeMap |
出站理賠的預設理賠類型映射。 |
屬性
| 名稱 | Description |
|---|---|
| CanValidateToken |
回傳一個值,指示此處理器是否能驗證 。SecurityToken |
| CanWriteToken |
取得表示此實例是否能寫入 SecurityToken的值。 |
| InboundClaimFilter |
在填充ClaimsIdentity申請JwtSecurityToken時,取得或設定 來ISet<T>過濾理賠。 當 a JwtSecurityToken 被驗證時,該類型中出現 ISet<T> 的主張不會被加入 ClaimsIdentity。 預設值為 ClaimTypeMapping.InboundClaimFilter。 |
| InboundClaimTypeMap |
取得或設定 , InboundClaimTypeMap 該 用於設定 Type , ClaimsPrincipal 在驗證 a JwtSecurityToken時擷取 。 在使用此映射轉換後,會 Type 設定為 JSON 權利要求的「名稱」。 預設值為 ClaimTypeMapping.InboundClaimTypeMap。 |
| JsonClaimTypeProperty |
取得或設定 will 包含 .Net 類型的屬性名稱 Properties ,該類型在序列化為 JSON 時 Claims 被識別。 另見 <cref=“P:System.IdentityModel.Tokens.Jwt.JwtSecurityTokenHandler.InboundClaimTypeMap”></參見。> |
| MapInboundClaims |
取得或設定 MapInboundClaims 屬性,用於判斷是否映射驗證時 JwtSecurityToken提取的權利要求類型。 若此值設為 true,則在使用此映射轉換後,該 Type 會被設定為 JSON 聲明的「名稱」。 否則,不會發生映射。 預設值為 True。 |
| MaximumTokenSizeInBytes |
取得並設定將要處理的最大符號大小(位元組)。 (繼承來源 TokenHandler) |
| OutboundAlgorithmMap |
取得傳給 JwtHeader 建構子的出站演算法映射。 |
| OutboundClaimTypeMap |
取得或設定 ,OutboundClaimTypeMap該 用於從 (s) 建立 。JwtSecurityTokenClaim JSON 宣稱的「名稱」值在使用此映射轉換後設定為 。Type 預設值為 ClaimTypeMapping.OutboundClaimTypeMap |
| SetDefaultTimesOnTokenCreation |
取得或設定一個布爾值,控制代幣創建時是否會設定預設的「經驗值」、「nbf」或「iat」(未指定)。 (繼承來源 TokenHandler) |
| ShortClaimTypeProperty |
若在建立時Properties有映射,則取得或設定 will(檔案)的屬性名稱Claim包含原始 JSON 聲明的「名稱」。 另見 <cref=“P:System.IdentityModel.Tokens.Jwt.JwtSecurityTokenHandler.InboundClaimTypeMap”></參見。> |
| TokenLifetimeInMinutes |
能在幾分鐘內取得或設定代幣壽命。 (繼承來源 TokenHandler) |
| TokenType |
取得 JwtSecurityToken的型別。 |