Language

JwtSecurityTokenHandler.CreateEncodedJwt メソッド

定義

オーバーロード

CreateEncodedJwt(SecurityTokenDescriptor)

Json Web トークン (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

パラメーター

tokenDescriptor
SecurityTokenDescriptor

トークンの内容の詳細を含む SecurityTokenDescriptor 。

返品

注釈

JWS と JWE を返すことができます。

EncryptingCredentials指定すると、JWE が作成されます。

SigningCredentialsが指定されている場合は、JWS が作成されます。

両方が指定されている場合は、JWS が埋め込まれた JWE が作成されます。

適用対象

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

'コンパクト シリアル化形式' で JWT を作成します。

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

パラメーター

issuer
String

トークンの発行者。

audience
String

このトークンの対象ユーザー。

subject
ClaimsIdentity

このトークンの Claimのソース。

notBefore
Nullable<DateTime>

このトークンの前の時間。

expires
Nullable<DateTime>

このトークンの有効期限。

issuedAt
Nullable<DateTime>

このトークンの発行時間。

signingCredentials
SigningCredentials

署名を生成するための暗号化マテリアルが含まれています。

返品

"コンパクト シリアル化形式" の Base64UrlEncoded 文字列。

注釈

Actorが null でない場合、要求 { actort, 'value' } がペイロードに追加されます。 値の作成方法の詳細については、 CreateActorValue(ClaimsIdentity) を参照してください。

ヘッダーに HeaderParameters を追加する方法の詳細については、 <seealso cref="T:System.IdentityModel.Tokens.Jwt.JwtHeader"></seealso> を参照してください。

ペイロードに値を追加する方法の詳細については、 <seealso cref="T:System.IdentityModel.Tokens.Jwt.JwtPayload"></seealso> を参照してください。

subject内の各Claimは、OutboundClaimTypeMapを適用してTypeをマップします。 OutboundClaimTypeMapを変更すると、送信 JWT が変更される可能性があります。

SigningCredentialsが指定されている場合は、JWS が作成されます。

適用対象

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

'コンパクト シリアル化形式' で JWT を作成します。

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

パラメーター

issuer
String

トークンの発行者。

audience
String

このトークンの対象ユーザー。

subject
ClaimsIdentity

このトークンの Claimのソース。

notBefore
Nullable<DateTime>

"エポック時間" に変換され、'nbf' に割り当てられます。

expires
Nullable<DateTime>

"エポック時間" に変換され、'exp' に割り当てられます。

issuedAt
Nullable<DateTime>

"エポック時間" に変換され、"iat" に割り当てられます。

signingCredentials
SigningCredentials

署名用の暗号化マテリアルが含まれています。

encryptingCredentials
EncryptingCredentials

暗号化用の暗号化マテリアルが含まれています。

返品

"コンパクト シリアル化形式" の Base64UrlEncoded 文字列。

例外

'expires' <= 'notBefore' の場合。

注釈

Actorが null でない場合、要求 { actort, 'value' } がペイロードに追加されます。 CreateActorValue(ClaimsIdentity) 値の作成方法について詳しく説明します。

ヘッダーに HeaderParameters を追加する方法の詳細については、 <seealso cref="T:System.IdentityModel.Tokens.Jwt.JwtHeader"></seealso> を参照してください。

ペイロードに値を追加する方法の詳細については、 <seealso cref="T:System.IdentityModel.Tokens.Jwt.JwtPayload"></seealso> を参照してください。

subject内の各Claimは、OutboundClaimTypeMapを適用してTypeをマップします。 OutboundClaimTypeMapを変更すると、送信 JWT が変更される可能性があります。

適用対象

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

'コンパクト シリアル化形式' で JWT を作成します。

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

パラメーター

issuer
String

トークンの発行者。

audience
String

このトークンの対象ユーザー。

subject
ClaimsIdentity

このトークンの Claimのソース。

notBefore
Nullable<DateTime>

"エポック時間" に変換され、'nbf' に割り当てられます。

expires
Nullable<DateTime>

"エポック時間" に変換され、'exp' に割り当てられます。

issuedAt
Nullable<DateTime>

"エポック時間" に変換され、"iat" に割り当てられます。

signingCredentials
SigningCredentials

署名用の暗号化マテリアルが含まれています。

encryptingCredentials
EncryptingCredentials

暗号化用の暗号化マテリアルが含まれています。

claimCollection
IDictionary<String,Object>

このトークンの Claimを表す (キー、値) ペアのコレクション。

返品

"コンパクト シリアル化形式" の Base64UrlEncoded 文字列。

例外

'expires' <= 'notBefore' の場合。

注釈

Actorが null でない場合、要求 { actort, 'value' } がペイロードに追加されます。 CreateActorValue(ClaimsIdentity) 値の作成方法について詳しく説明します。

ヘッダーに HeaderParameters を追加する方法の詳細については、 <seealso cref="T:System.IdentityModel.Tokens.Jwt.JwtHeader"></seealso> を参照してください。

ペイロードに値を追加する方法の詳細については、 <seealso cref="T:System.IdentityModel.Tokens.Jwt.JwtPayload"></seealso> を参照してください。

subject内の各Claimは、OutboundClaimTypeMapを適用してTypeをマップします。 OutboundClaimTypeMapを変更すると、送信 JWT が変更される可能性があります。

適用対象