Ejemplo n.º 1
0
 /// <summary>
 /// Check if token expired by time
 /// (tolerance applies)
 /// </summary>
 /// <param name="dateTime">Time for check</param>
 /// <param name="tolerance">tolerance in seconds</param>
 /// <returns>true if expired</returns>
 public bool Expired(DateTime dateTime, long tolerance)
 {
     return(ExpiresAt.CompareTo(dateTime.AddSeconds(-tolerance)) <= 0);
 }
Ejemplo n.º 2
0
 public virtual bool HasExpired()
 {
     return(ExpiresAt.CompareTo(DateTime.Now) <= 0);
 }
Ejemplo n.º 3
0
 /// <summary>
 /// Check if token expired by time
 /// (tolerance applies)
 /// </summary>
 /// <param name="dateTime">Time for check</param>
 /// <returns>true if expired</returns>
 private bool Expired(DateTime dateTime)
 {
     return(ExpiresAt.CompareTo(dateTime) <= 0);
 }