示例#1
0
        public bool ValidateClientToken(string token)
        {
            if (String.IsNullOrEmpty(token))
            {
                return(false);
            }

            string decryptedToken = _symmetricEncryptionProvider.Decrypt(token, GetStandardEncryptionInfo());
            Token  t = _packingService.UnpackToken(decryptedToken);

            if (DateTime.Now - t.Timestamp > new TimeSpan(0, 0, 30, 0))
            {
                return(false);
            }

            if (!t.Data.Equals(_keyPairService.GetTokenFromFile()))
            {
                return(false);
            }

            return(true);
        }