D
D
Dmitry Afonchenko2015-10-11 13:58:17
In contact with
Dmitry Afonchenko, 2015-10-11 13:58:17

Why is the VK API token not received during authorization?

Good afternoon, comrades, the following question appeared. I'm trying to figure out the VK API, but I'm stuck at the very beginning of the journey. The code below is supposed to return a token, but instead it returns my application ID. Actually the question is why is that so? I did everything according to this video tutorial www.youtube.com/watch?v=TUnqd7ySdl0

public string VkAuth(string Login, string Pass)
        {
            
            using (var req = new HttpRequest())
            {
                req.UserAgent = Http.ChromeUserAgent();
                CookieDictionary cookies = new CookieDictionary(false);
                req.Cookies = cookies;

                req.Get(String.Format("https://login.vk.com/?act=login&email={0}&pass={1}", Login, Pass));

                String Data = req.Get(String.Format("https://oauth.vk.com/authorize?client_id={0}&scope=offline,group,photos,wall&display=page&response_type=token&redirect_uri=https://oauth.vk.com/blank.html", AppID, Scope)).ToString();
                //req.AllowAutoRedirect = true;

                char[] simbol = {'=','&'};
                string[] strData = req.Response.Address.ToString().Split(simbol);

                Token = strData[1];
                UserID = strData[5];

                return strData[1];
            }
        }

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question