示例#1
0
        public virtual string GenerateAuthUrl(AuthenticationDto authResultDto)
        {
            var secret = HttpContext.Session.GetString(SecurityConstants.ClientSecret);

            authResultDto.Secret = secret;

            var serialisedResult = authResultDto.Serialize();

            string token = SecurityHelper.EncryptString(serialisedResult, MobileIdConfiguration.Key);

            return($"{MobileIdConfiguration.RedirectUrl}{token}");
        }
        //Default encryption can be overwritten with custom encryption
        public virtual string EncryptResponse(AuthenticationDto authenticationDto)
        {
            var serialisedResult = authenticationDto.Serialize();

            return(SecurityHelper.EncryptString(serialisedResult, GetKey()));
        }