public void UpdateToken() { IssuedAt = DateTime.UtcNow; NotBefore = IssuedAt; Expiration = IssuedAt.Add(ValidFor); }
public JwtIssuerFactory(IOptions <JwtIssuerSettings> options) { Issuer = options.Value.Issuer; Audience = options.Value.Audience; IssuedAt = DateTime.UtcNow; NotBefore = IssuedAt; ValidFor = TimeSpan.FromMinutes(options.Value.ValidFor); Expires = IssuedAt.Add(ValidFor); var key = new SymmetricSecurityKey(Encoding.ASCII.GetBytes(options.Value.SecretKey)); SigningCredentials = new SigningCredentials(key, SecurityAlgorithms.HmacSha256); }
public DateTime Expiration() => IssuedAt.Add(ValidFor);