JwtSecurityTokenHandler.ValidateLifetime Method
Validates ValidFrom and ValidTo.
Namespace: System.IdentityModel.Tokens
Assembly: System.IdentityModel.Tokens.Jwt (in System.IdentityModel.Tokens.Jwt.dll)
Syntax
'Declaration
Protected Overridable Sub ValidateLifetime ( _
jwt As JwtSecurityToken _
)
protected virtual void ValidateLifetime(
JwtSecurityToken jwt
)
protected:
virtual void ValidateLifetime(
JwtSecurityToken^ jwt
)
abstract ValidateLifetime :
jwt:JwtSecurityToken -> unit
override ValidateLifetime :
jwt:JwtSecurityToken -> unit
protected function ValidateLifetime(
jwt : JwtSecurityToken
)
Parameters
jwt
Type: System.IdentityModel.Tokens.JwtSecurityTokenThe JwtSecurityToken to validate.
Exceptions
Exception | Condition |
---|---|
ArgumentNullException | 'jwt' is null. |
SecurityTokenValidationException | JwtSecurityToken does not contain the claim { exp, 'value' } and RequireExpirationTime is true. -or-ValidFrom is after ValidTo. |
Remarks
RequireExpirationTime mandates if claim { exp, 'value' } is required. Default is true.If the JwtSecurityToken contains the claim { exp, 'value' } it will be validated regardless of RequireExpirationTime.
If the JwtSecurityToken contains the claim { nbf, 'value' } it will be validated.
MaxClockSkew is applied.
.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.