bool ValidateExpiry(SharedAccessSignature sharedAccessSignature, IIdentity identity) { if (sharedAccessSignature.IsExpired()) { Events.TokenExpired(identity); return(false); } return(true); }
public static bool IsTokenExpired(string hostName, string token) { try { SharedAccessSignature sharedAccessSignature = SharedAccessSignature.Parse(hostName, token); return(sharedAccessSignature.IsExpired()); } catch (UnauthorizedAccessException) { return(true); } }