Język

JwtSecurityTokenHandler.CreateEncodedJwt Metoda

Definicja

Przeciążenia

CreateEncodedJwt(SecurityTokenDescriptor)

Zwraca token internetowy Json (JWT).

public virtual string CreateEncodedJwt(Microsoft.IdentityModel.Tokens.SecurityTokenDescriptor tokenDescriptor);
abstract member CreateEncodedJwt : Microsoft.IdentityModel.Tokens.SecurityTokenDescriptor -> string
override this.CreateEncodedJwt : Microsoft.IdentityModel.Tokens.SecurityTokenDescriptor -> string
Public Overridable Function CreateEncodedJwt (tokenDescriptor As SecurityTokenDescriptor) As String

Parametry

tokenDescriptor
SecurityTokenDescriptor

Element SecurityTokenDescriptor zawierający szczegóły zawartości tokenu.

Zwraca

Uwagi

Można zwrócić JWS i JWE.

Jeśli EncryptingCredentialszostanie podany, zostanie utworzony zestaw JWE.

Jeśli SigningCredentials zostanie podany, zostanie utworzony zestaw JWS.

Jeśli oba te elementy zostaną udostępnione, zostanie utworzony zestaw JWE z osadzonym zestawem JWS.

Dotyczy

CreateEncodedJwt(String, String, ClaimsIdentity, Nullable<DateTime>, Nullable<DateTime>, Nullable<DateTime>, SigningCredentials)

Tworzy JWT w formacie "Compact Serialization Format".

public virtual string CreateEncodedJwt(string issuer, string audience, System.Security.Claims.ClaimsIdentity subject, DateTime? notBefore, DateTime? expires, DateTime? issuedAt, Microsoft.IdentityModel.Tokens.SigningCredentials signingCredentials);
abstract member CreateEncodedJwt : string * string * System.Security.Claims.ClaimsIdentity * Nullable<DateTime> * Nullable<DateTime> * Nullable<DateTime> * Microsoft.IdentityModel.Tokens.SigningCredentials -> string
override this.CreateEncodedJwt : string * string * System.Security.Claims.ClaimsIdentity * Nullable<DateTime> * Nullable<DateTime> * Nullable<DateTime> * Microsoft.IdentityModel.Tokens.SigningCredentials -> string
Public Overridable Function CreateEncodedJwt (issuer As String, audience As String, subject As ClaimsIdentity, notBefore As Nullable(Of DateTime), expires As Nullable(Of DateTime), issuedAt As Nullable(Of DateTime), signingCredentials As SigningCredentials) As String

Parametry

issuer
String

Wystawca tokenu.

audience
String

Odbiorcy tego tokenu.

subject
ClaimsIdentity

Źródło Claim(s) dla tego tokenu.

notBefore
Nullable<DateTime>

Czas notbefore dla tego tokenu.

expires
Nullable<DateTime>

Czas wygaśnięcia tego tokenu.

issuedAt
Nullable<DateTime>

Czas problemu dla tego tokenu.

signingCredentials
SigningCredentials

Zawiera materiał kryptograficzny do generowania podpisu.

Zwraca

Ciąg Base64UrlEncoded w formacie "Compact Serialization Format".

Uwagi

Jeśli Actor wartość nie ma wartości null, oświadczenie { actort, "value" } zostanie dodane do ładunku. Zobacz CreateActorValue(ClaimsIdentity) , aby uzyskać szczegółowe informacje na temat sposobu tworzenia wartości.

Zobacz <seealso cref="T:System.IdentityModel.Tokens.Jwt.JwtHeader"></seealso> , aby uzyskać szczegółowe informacje na temat sposobu dodawania parametrów nagłówka do nagłówka.

Zobacz <seealso cref="T:System.IdentityModel.Tokens.Jwt.JwtPayload"></seealso> , aby uzyskać szczegółowe informacje na temat sposobu dodawania wartości do ładunku.

Każda Claim z nich subject zostanie zamapowany OutboundClaimTypeMapType przez zastosowanie elementu . Modyfikowanie OutboundClaimTypeMap może spowodować zmianę ruchu wychodzącego JWT.

Jeśli SigningCredentials zostanie podany, zostanie utworzony zestaw JWS.

Dotyczy

CreateEncodedJwt(String, String, ClaimsIdentity, Nullable<DateTime>, Nullable<DateTime>, Nullable<DateTime>, SigningCredentials, EncryptingCredentials)

Tworzy JWT w formacie "Compact Serialization Format".

public virtual string CreateEncodedJwt(string issuer, string audience, System.Security.Claims.ClaimsIdentity subject, DateTime? notBefore, DateTime? expires, DateTime? issuedAt, Microsoft.IdentityModel.Tokens.SigningCredentials signingCredentials, Microsoft.IdentityModel.Tokens.EncryptingCredentials encryptingCredentials);
abstract member CreateEncodedJwt : string * string * System.Security.Claims.ClaimsIdentity * Nullable<DateTime> * Nullable<DateTime> * Nullable<DateTime> * Microsoft.IdentityModel.Tokens.SigningCredentials * Microsoft.IdentityModel.Tokens.EncryptingCredentials -> string
override this.CreateEncodedJwt : string * string * System.Security.Claims.ClaimsIdentity * Nullable<DateTime> * Nullable<DateTime> * Nullable<DateTime> * Microsoft.IdentityModel.Tokens.SigningCredentials * Microsoft.IdentityModel.Tokens.EncryptingCredentials -> string
Public Overridable Function CreateEncodedJwt (issuer As String, audience As String, subject As ClaimsIdentity, notBefore As Nullable(Of DateTime), expires As Nullable(Of DateTime), issuedAt As Nullable(Of DateTime), signingCredentials As SigningCredentials, encryptingCredentials As EncryptingCredentials) As String

Parametry

issuer
String

Wystawca tokenu.

audience
String

Odbiorcy tego tokenu.

subject
ClaimsIdentity

Źródło Claim(s) dla tego tokenu.

notBefore
Nullable<DateTime>

Przetłumaczone na "czas epoki" i przypisane do "nbf".

expires
Nullable<DateTime>

Przetłumaczone na czas epoki i przypisane do 'exp'.

issuedAt
Nullable<DateTime>

Przetłumaczone na "czas epoki" i przypisane do "iat".

signingCredentials
SigningCredentials

Zawiera materiał kryptograficzny do podpisywania.

encryptingCredentials
EncryptingCredentials

Zawiera materiał kryptograficzny do szyfrowania.

Zwraca

Ciąg Base64UrlEncoded w formacie "Compact Serialization Format".

Wyjątki

Jeśli 'wygasa' <= 'notBefore'.

Uwagi

Jeśli Actor wartość nie ma wartości null, oświadczenie { actort, "value" } zostanie dodane do ładunku. CreateActorValue(ClaimsIdentity) aby uzyskać szczegółowe informacje na temat sposobu tworzenia wartości.

Zobacz <seealso cref="T:System.IdentityModel.Tokens.Jwt.JwtHeader"></seealso> , aby uzyskać szczegółowe informacje na temat sposobu dodawania parametrów nagłówka do nagłówka.

Zobacz <seealso cref="T:System.IdentityModel.Tokens.Jwt.JwtPayload"></seealso> , aby uzyskać szczegółowe informacje na temat sposobu dodawania wartości do ładunku.

Każda Claim z nich subject zostanie zamapowany OutboundClaimTypeMapType przez zastosowanie elementu . Modyfikowanie OutboundClaimTypeMap może spowodować zmianę ruchu wychodzącego JWT.

Dotyczy

CreateEncodedJwt(String, String, ClaimsIdentity, Nullable<DateTime>, Nullable<DateTime>, Nullable<DateTime>, SigningCredentials, EncryptingCredentials, IDictionary<String,Object>)

Tworzy JWT w formacie "Compact Serialization Format".

public virtual string CreateEncodedJwt(string issuer, string audience, System.Security.Claims.ClaimsIdentity subject, DateTime? notBefore, DateTime? expires, DateTime? issuedAt, Microsoft.IdentityModel.Tokens.SigningCredentials signingCredentials, Microsoft.IdentityModel.Tokens.EncryptingCredentials encryptingCredentials, System.Collections.Generic.IDictionary<string,object> claimCollection);
abstract member CreateEncodedJwt : string * string * System.Security.Claims.ClaimsIdentity * Nullable<DateTime> * Nullable<DateTime> * Nullable<DateTime> * Microsoft.IdentityModel.Tokens.SigningCredentials * Microsoft.IdentityModel.Tokens.EncryptingCredentials * System.Collections.Generic.IDictionary<string, obj> -> string
override this.CreateEncodedJwt : string * string * System.Security.Claims.ClaimsIdentity * Nullable<DateTime> * Nullable<DateTime> * Nullable<DateTime> * Microsoft.IdentityModel.Tokens.SigningCredentials * Microsoft.IdentityModel.Tokens.EncryptingCredentials * System.Collections.Generic.IDictionary<string, obj> -> string
Public Overridable Function CreateEncodedJwt (issuer As String, audience As String, subject As ClaimsIdentity, notBefore As Nullable(Of DateTime), expires As Nullable(Of DateTime), issuedAt As Nullable(Of DateTime), signingCredentials As SigningCredentials, encryptingCredentials As EncryptingCredentials, claimCollection As IDictionary(Of String, Object)) As String

Parametry

issuer
String

Wystawca tokenu.

audience
String

Odbiorcy tego tokenu.

subject
ClaimsIdentity

Źródło Claim(s) dla tego tokenu.

notBefore
Nullable<DateTime>

Przetłumaczone na "czas epoki" i przypisane do "nbf".

expires
Nullable<DateTime>

Przetłumaczone na czas epoki i przypisane do 'exp'.

issuedAt
Nullable<DateTime>

Przetłumaczone na "czas epoki" i przypisane do "iat".

signingCredentials
SigningCredentials

Zawiera materiał kryptograficzny do podpisywania.

encryptingCredentials
EncryptingCredentials

Zawiera materiał kryptograficzny do szyfrowania.

claimCollection
IDictionary<String,Object>

Kolekcja par (klucz,wartość) reprezentujących Claim(s) dla tego tokenu.

Zwraca

Ciąg Base64UrlEncoded w formacie "Compact Serialization Format".

Wyjątki

Jeśli 'wygasa' <= 'notBefore'.

Uwagi

Jeśli Actor wartość nie ma wartości null, oświadczenie { actort, "value" } zostanie dodane do ładunku. CreateActorValue(ClaimsIdentity) aby uzyskać szczegółowe informacje na temat sposobu tworzenia wartości.

Zobacz <seealso cref="T:System.IdentityModel.Tokens.Jwt.JwtHeader"></seealso> , aby uzyskać szczegółowe informacje na temat sposobu dodawania parametrów nagłówka do nagłówka.

Zobacz <seealso cref="T:System.IdentityModel.Tokens.Jwt.JwtPayload"></seealso> , aby uzyskać szczegółowe informacje na temat sposobu dodawania wartości do ładunku.

Każda Claim z nich subject zostanie zamapowany OutboundClaimTypeMapType przez zastosowanie elementu . Modyfikowanie OutboundClaimTypeMap może spowodować zmianę ruchu wychodzącego JWT.

Dotyczy