Esempio n. 1
0
        public async Task <ActionResult> Callback([Bind(Prefix = "oauth_verifier")] string verifier, [Bind(Prefix = "oauth_token")] string oauthToken)
        {
            var token = RequestToken;

            if (token == null)
            {
                return(Redirect("~/login"));
            }

            if (token.Key != oauthToken)
            {
                return(View("error"));
            }

            var accessToken = await _oauth.GetAccessToken(token, verifier);

            _identity.Update(accessToken, await QueryInfo(msg => _oauth.Sign(msg, accessToken)));

            return(Redirect(RedirectTo ?? "~/"));
        }