Język

JwtSecurityTokenHandler.CreateJwtSecurityToken Metoda

Definicja

Przeciążenia

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

Tworzy obiekt JwtSecurityToken

public virtual System.IdentityModel.Tokens.Jwt.JwtSecurityToken CreateJwtSecurityToken(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 CreateJwtSecurityToken : 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> -> System.IdentityModel.Tokens.Jwt.JwtSecurityToken
override this.CreateJwtSecurityToken : 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> -> System.IdentityModel.Tokens.Jwt.JwtSecurityToken
Public Overridable Function CreateJwtSecurityToken (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 JwtSecurityToken

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.

encryptingCredentials
EncryptingCredentials

Zawiera materiał kryptograficzny do szyfrowania tokenu.

claimCollection
IDictionary<String,Object>

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

Zwraca

Element JwtSecurityToken.

Wyjątki

If expires<= 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żdy Claim z dodanych subject zostanie Type przetłumaczony zgodnie z mapowaniem znalezionym w pliku OutboundClaimTypeMap. Dodanie i usunięcie OutboundClaimTypeMap elementu spowoduje wpływ na składnik nazwy oświadczenia Json.

SigningCredentials(SecurityKey, String) służy do podpisywania RawData.

EncryptingCredentials(SecurityKey, String, String) służy do szyfrowania RawData lub RawPayload .

Dotyczy

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

Tworzy obiekt JwtSecurityToken

public virtual System.IdentityModel.Tokens.Jwt.JwtSecurityToken CreateJwtSecurityToken(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 CreateJwtSecurityToken : string * string * System.Security.Claims.ClaimsIdentity * Nullable<DateTime> * Nullable<DateTime> * Nullable<DateTime> * Microsoft.IdentityModel.Tokens.SigningCredentials * Microsoft.IdentityModel.Tokens.EncryptingCredentials -> System.IdentityModel.Tokens.Jwt.JwtSecurityToken
override this.CreateJwtSecurityToken : string * string * System.Security.Claims.ClaimsIdentity * Nullable<DateTime> * Nullable<DateTime> * Nullable<DateTime> * Microsoft.IdentityModel.Tokens.SigningCredentials * Microsoft.IdentityModel.Tokens.EncryptingCredentials -> System.IdentityModel.Tokens.Jwt.JwtSecurityToken
Public Overridable Function CreateJwtSecurityToken (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 JwtSecurityToken

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.

encryptingCredentials
EncryptingCredentials

Zawiera materiał kryptograficzny do szyfrowania tokenu.

Zwraca

Element JwtSecurityToken.

Wyjątki

If expires<= 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żdy Claim z dodanych subject zostanie Type przetłumaczony zgodnie z mapowaniem znalezionym w pliku OutboundClaimTypeMap. Dodanie i usunięcie OutboundClaimTypeMap elementu spowoduje wpływ na składnik nazwy oświadczenia Json.

SigningCredentials(SecurityKey, String) służy do podpisywania RawData.

EncryptingCredentials(SecurityKey, String, String) służy do szyfrowania RawData lub RawPayload .

Dotyczy

CreateJwtSecurityToken(SecurityTokenDescriptor)

Tworzy token internetowy Json (JWT).

public virtual System.IdentityModel.Tokens.Jwt.JwtSecurityToken CreateJwtSecurityToken(Microsoft.IdentityModel.Tokens.SecurityTokenDescriptor tokenDescriptor);
abstract member CreateJwtSecurityToken : Microsoft.IdentityModel.Tokens.SecurityTokenDescriptor -> System.IdentityModel.Tokens.Jwt.JwtSecurityToken
override this.CreateJwtSecurityToken : Microsoft.IdentityModel.Tokens.SecurityTokenDescriptor -> System.IdentityModel.Tokens.Jwt.JwtSecurityToken
Public Overridable Function CreateJwtSecurityToken (tokenDescriptor As SecurityTokenDescriptor) As JwtSecurityToken

Parametry

tokenDescriptor
SecurityTokenDescriptor

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

Zwraca

Uwagi

SigningCredentials służy do podpisywania RawData.

Dotyczy

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

Tworzy obiekt JwtSecurityToken

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

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

Element JwtSecurityToken.

Wyjątki

If expires<= 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żdy Claim z dodanych subject zostanie Type przetłumaczony zgodnie z mapowaniem znalezionym w pliku OutboundClaimTypeMap. Dodanie i usunięcie OutboundClaimTypeMap elementu spowoduje wpływ na składnik nazwy oświadczenia Json.

SigningCredentials(SecurityKey, String) służy do podpisywania RawData.

Dotyczy