Esempio n. 1
0
        public async Task <bool> LoginOpenIdAsync(string url)
        {
            var response = await http.GetAsync(url);

            var content = await response.Content.ReadAsStringAsync();

            var dic = await HTMLUtils.GetSteamOpenId(content);

            if (dic.Count == 0)
            {
                return(false);
            }

            response = await http.PostAsync(SteamApiEndpoints.OpenId, new FormUrlEncodedContent(dic));

            //HACK: allow https->http redirect
            if (response.StatusCode == HttpStatusCode.Redirect)
            {
                response = await http.GetAsync(response.Headers.Location);
            }
            return(true);
        }