JwtSecurityTokenHandler.CreateToken Method (SecurityTokenDescriptor)
Creates a JwtSecurityToken based on values found in the SecurityTokenDescriptor.
Namespace: System.IdentityModel.Tokens
Assembly: System.IdentityModel.Tokens.Jwt (in System.IdentityModel.Tokens.Jwt.dll)
Syntax
'Declaration
Public Overridable Function CreateToken ( _
tokenDescriptor As SecurityTokenDescriptor _
) As SecurityToken
public virtual SecurityToken CreateToken(
SecurityTokenDescriptor tokenDescriptor
)
public:
virtual SecurityToken^ CreateToken(
SecurityTokenDescriptor^ tokenDescriptor
)
abstract CreateToken :
tokenDescriptor:SecurityTokenDescriptor -> SecurityToken
override CreateToken :
tokenDescriptor:SecurityTokenDescriptor -> SecurityToken
public function CreateToken(
tokenDescriptor : SecurityTokenDescriptor
) : SecurityToken
Parameters
tokenDescriptor
Type: System.IdentityModel.Tokens.SecurityTokenDescriptorContains the parameters used to create the token.
Return Value
Type: System.IdentityModel.Tokens.SecurityToken
A JwtSecurityToken.
Exceptions
Exception | Condition |
---|---|
ArgumentNullException | 'tokenDescriptor' is null. |
Remarks
If SigningCredentials is not null, RawData will be signed.
.NET Framework Security
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.