コード例 #1
0
        bool ValidateExpiry(SharedAccessSignature sharedAccessSignature, IIdentity identity)
        {
            if (sharedAccessSignature.IsExpired())
            {
                Events.TokenExpired(identity);
                return(false);
            }

            return(true);
        }
コード例 #2
0
 public static bool IsTokenExpired(string hostName, string token)
 {
     try
     {
         SharedAccessSignature sharedAccessSignature = SharedAccessSignature.Parse(hostName, token);
         return(sharedAccessSignature.IsExpired());
     }
     catch (UnauthorizedAccessException)
     {
         return(true);
     }
 }