JwtSecurityTokenHandler.ValidateSignature Method (JwtSecurityToken)
Validates the signature of a JwtSecurityToken
Namespace: System.IdentityModel.Tokens
Assembly: System.IdentityModel.Tokens.Jwt (in System.IdentityModel.Tokens.Jwt.dll)
Syntax
'Declaration
Protected Overridable Sub ValidateSignature ( _
jwt As JwtSecurityToken _
)
protected virtual void ValidateSignature(
JwtSecurityToken jwt
)
protected:
virtual void ValidateSignature(
JwtSecurityToken^ jwt
)
abstract ValidateSignature :
jwt:JwtSecurityToken -> unit
override ValidateSignature :
jwt:JwtSecurityToken -> unit
protected function ValidateSignature(
jwt : JwtSecurityToken
)
Parameters
jwt
Type: System.IdentityModel.Tokens.JwtSecurityTokenJwtSecurityToken to validate.
Exceptions
Exception | Condition |
---|---|
ArgumentNullException | 'jwt' is null. |
InvalidOperationException | JwtSecurityTokenHandler.Configuration is null. -or-JwtSecurityTokenHandler.Configuration.IssuerTokenResolver is null. |
SecurityTokenValidationException | ResolveToken returns null. -or- signature is not valid. |
Remarks
If validation is successful, SigningToken and SigningKey will be set to the SecurityToken and SecurityKey the validated the signature.
.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.