/// <summary>
        /// Step2:通过Authorization Code获取Access Token
        /// </summary>
        /// <param name="entity"></param>
        /// <returns></returns>
        public async Task <QQ_AccessToken_ResultEntity> AccessToken(QQ_AccessToken_RequestEntity entity)
        {
            if (!LoginBase.IsValid(entity))
            {
                return(null);
            }

            string pars = LoginBase.EntityToPars(entity);

            var config = await _qqConfigProvider.GetConfigAsync();

            config.CheckNotNull(nameof(config));

            string result = HttpTo.Get(config.API_AccessToken_PC + "?" + pars);

            List <string> listPars = result.Split('&').ToList();
            var           jo       = new JObject();

            foreach (string item in listPars)
            {
                var items = item.Split('=').ToList();
                jo[items.FirstOrDefault()] = items.LastOrDefault();
            }

            var outmo = LoginBase.ResultOutput <QQ_AccessToken_ResultEntity>(Newtonsoft.Json.JsonConvert.SerializeObject(jo));

            return(outmo);
        }
        /// <summary>
        /// Step2:获取授权过的Access Token
        /// </summary>
        /// <param name="entity"></param>
        /// <returns></returns>
        public async Task <Taobao_AccessToken_ResultEntity> AccessToken(Taobao_AccessToken_RequestEntity entity)
        {
            if (!LoginBase.IsValid(entity))
            {
                return(null);
            }

            var config = await _taobaoConfigProvider.GetConfigAsync();

            config.CheckNotNull(nameof(config));

            string pars   = LoginBase.EntityToPars(entity);
            string result = HttpTo.Post(config.API_AccessToken, pars);
            var    outmo  = LoginBase.ResultOutput <Taobao_AccessToken_ResultEntity>(result);

            return(outmo);
        }
        /// <summary>
        /// Step3:查询用户access_token的授权相关信息,包括授权时间,过期时间和scope权限。
        /// </summary>
        /// <param name="entity"></param>
        /// <returns></returns>
        public async Task <Weibo_GetTokenInfo_ResultEntity> GetTokenInfo(Weibo_GetTokenInfo_RequestEntity entity)
        {
            if (!LoginBase.IsValid(entity))
            {
                return(null);
            }

            var config = await _weibaoConfigProvider.GetConfigAsync();

            config.CheckNotNull(nameof(config));

            string pars   = LoginBase.EntityToPars(entity);
            string result = HttpTo.Post(config.API_GetTokenInfo, pars);

            var outmo = LoginBase.ResultOutput <Weibo_GetTokenInfo_ResultEntity>(result);

            return(outmo);
        }
        /// <summary>
        /// Step3:获取用户信息
        /// </summary>
        /// <param name="entity"></param>
        /// <returns></returns>
        public async Task <WeChat_OpenId_get_user_info_ResultEntity> Get_User_Info(WeChat_OpenAPI_RequestEntity entity)
        {
            if (!LoginBase.IsValid(entity))
            {
                return(null);
            }

            var config = await _wechatConfigProvider.GetConfigAsync();

            config.CheckNotNull(nameof(config));

            string pars   = LoginBase.EntityToPars(entity);
            string result = HttpTo.Get(config.API_UserInfo + "?" + pars);

            var outmo = LoginBase.ResultOutput <WeChat_OpenId_get_user_info_ResultEntity>(result.Replace("\r\n", ""));

            return(outmo);
        }
        /// <summary>
        /// Step4:根据用户ID获取用户信息
        /// </summary>
        /// <param name="entity"></param>
        /// <returns></returns>
        public async Task <Weibo_UserShow_ResultEntity> UserShow(Weibo_UserShow_RequestEntity entity)
        {
            if (!LoginBase.IsValid(entity))
            {
                return(null);
            }

            var config = await _weibaoConfigProvider.GetConfigAsync();

            config.CheckNotNull(nameof(config));

            string pars   = LoginBase.EntityToPars(entity);
            string result = HttpTo.Get(config.API_UserShow + "?" + pars);

            var outmo = LoginBase.ResultOutput <Weibo_UserShow_ResultEntity>(result, new List <string> {
                "status"
            });

            return(outmo);
        }
        /// <summary>
        /// Step3:获取用户OpenId
        /// </summary>
        /// <param name="entity"></param>
        /// <returns></returns>
        public async Task <QQ_OpenId_ResultEntity> OpenId(QQ_OpenId_RequestEntity entity)
        {
            if (!LoginBase.IsValid(entity))
            {
                return(null);
            }

            var config = await _qqConfigProvider.GetConfigAsync();

            config.CheckNotNull(nameof(config));

            string pars   = LoginBase.EntityToPars(entity);
            string result = HttpTo.Get(config.API_OpenID_PC + "?" + pars);

            result = result.Replace("callback( ", "").Replace(" );", "");

            var outmo = LoginBase.ResultOutput <QQ_OpenId_ResultEntity>(result);

            return(outmo);
        }
        /// <summary>
        /// 获取 access token
        /// </summary>
        /// <param name="entity"></param>
        /// <returns></returns>
        public async Task <GitHub_AccessToken_ResultEntity> AccessToken(GitHub_AccessToken_RequestEntity entity)
        {
            if (!LoginBase.IsValid(entity))
            {
                return(null);
            }

            var config = await _githubConfigProvider.GetConfigAsync();

            config.CheckNotNull(nameof(config));

            string pars = LoginBase.EntityToPars(entity);

            var hwr = HttpTo.HWRequest(config.API_AccessToken, "POST", pars);

            hwr.Accept = "application/json";//application/xml
            string result = HttpTo.Url(hwr);

            var outmo = LoginBase.ResultOutput <GitHub_AccessToken_ResultEntity>(result);

            return(outmo);
        }
        /// <summary>
        /// 获取 用户信息
        /// </summary>
        /// <param name="entity"></param>
        /// <returns></returns>
        public async Task <MicroSoft_User_ResultEntity> User(MicroSoft_User_RequestEntity entity)
        {
            if (!LoginBase.IsValid(entity))
            {
                return(null);
            }

            var config = await _microsoftConfigProvider.GetConfigAsync();

            config.CheckNotNull(nameof(config));

            string pars = LoginBase.EntityToPars(entity);

            var hwr = HttpTo.HWRequest(config.API_User + "?" + pars);

            hwr.ContentType = null;
            string result = HttpTo.Url(hwr);
            var    outmo  = LoginBase.ResultOutput <MicroSoft_User_ResultEntity>(result, new List <string> {
                "emails"
            });

            return(outmo);
        }
        /// <summary>
        /// 获取 用户信息
        /// </summary>
        /// <param name="entity"></param>
        /// <returns></returns>
        public async Task <GitHub_User_ResultEntity> User(GitHub_User_RequestEntity entity)
        {
            if (!LoginBase.IsValid(entity))
            {
                return(null);
            }

            var config = await _githubConfigProvider.GetConfigAsync();

            config.CheckNotNull(nameof(config));

            string pars = LoginBase.EntityToPars(entity);

            var hwr = HttpTo.HWRequest(config.API_User + "?" + pars);

            hwr.UserAgent = entity.ApplicationName;
            string result = HttpTo.Url(hwr);

            var outmo = LoginBase.ResultOutput <GitHub_User_ResultEntity>(result, new List <string> {
                "plan"
            });

            return(outmo);
        }