Пример #1
0
        public async Task <IActionResult> LoginSuccess(string code)
        {
            // add this code to the auth object
            var auth = new OAuth(_config);

            // now we have to call back to instagram and include the code they gave us
            // along with our client secret
            var oauthResponse = await auth.RequestToken(code);

            // both the client secret and the token are considered sensitive data, so we won't be
            // sending them back to the browser. we'll only store them temporarily.  If a user's session times
            // out, they will have to click on the authenticate button again - sorry bout yer luck.
            HttpContext.Session.SetString("InstaSharp.AuthInfo", JsonConvert.SerializeObject(oauthResponse));


            var users  = new InstaSharp.Endpoints.Tags(_config, oauthResponse);
            var recent = await users.RecentMultiplePages("mood");


            return(View());
        }