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

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.

-or-ValidFrom is after UtcNow.

-or-ValidTo is after UtcNow.

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

See Also

Reference

JwtSecurityTokenHandler Class

System.IdentityModel.Tokens Namespace