Example #1
0
        public virtual bool DecryptAuthenticationToken(string authTokenEncrypted, out AuthenticationToken authToken)
        {
            try
            {
                var tokenData = Convert.FromBase64String(authTokenEncrypted);
                tokenData = this.CryptoProvider.Decrypt(tokenData);
                return(AuthenticationToken.TryDeserialize(tokenData, out authToken));
            }
            catch (Exception ex)
            {
                if (log.IsDebugEnabled)
                {
                    log.DebugFormat("DecryptAuthenticationToken failed: {0}", ex);
                }

                authToken = null;
                return(false);
            }
        }
Example #2
0
 protected virtual bool TryDeserializeToken(byte[] tokenData, out AuthenticationToken authToken, out string errorMsg)
 {
     return(AuthenticationToken.TryDeserialize(tokenData, out authToken, out errorMsg));
 }