JwtSecurityTokenHandler.DefaultTokenLifetimeInMinutes Property
Gets or sets the default token lifetime.
Namespace: System.IdentityModel.Tokens
Assembly: System.IdentityModel.Tokens.Jwt (in System.IdentityModel.Tokens.Jwt.dll)
Syntax
'Declaration
Public Property DefaultTokenLifetimeInMinutes As UInteger
public uint DefaultTokenLifetimeInMinutes { get; set; }
public:
property unsigned int DefaultTokenLifetimeInMinutes {
unsigned int get ();
void set (unsigned int value);
}
member DefaultTokenLifetimeInMinutes : uint32 with get, set
function get DefaultTokenLifetimeInMinutes () : uint
function set DefaultTokenLifetimeInMinutes (value : uint)
Property Value
Type: System.UInt32
Returns UInt32.
Exceptions
Exception | Condition |
---|---|
ArgumentOutOfRangeException | 'value' == 0. |
Remarks
This value is used when creating a JwtSecurityToken and the Lifetime is not specified.
If RequireExpirationTime is true, then an expiration claim { exp, 'value' } will added to the JwtPayload. 'value' = UtcNow + FromMinutes( DefaultTokenLifetimeInMinutes ).If only Created is specified, expiration will add to that value.
Default is 600 (minutes).
.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.