Example #1
0
        public static string GetEncryptToken(this Guid userKey)
        {
            var json = new ApiAuthToken(userKey, DateTime.UtcNow).ConvertToJson();
            var str1 = json.Encrypt(EncryptKey);
            var str2 = str1.Encrypt(EncryptSecondKey);

            return(str2);
        }
Example #2
0
 public static bool IsTokenAvaliable(this ApiAuthToken token, int tokenExpireMins)
 {
     return(token != null && token.UserKey != null && token.TimeStamp != null && (DateTime.UtcNow - (DateTime)token.TimeStamp).TotalMinutes < tokenExpireMins);
 }