public ActionResult Callback(string oauth_token, string oauth_verifier)
        {
            var tokenSecret = (string)TempData["OAuthTokenSecret"];

            Session["OAuthToken"] = oauth_token;

            var accessToken = _oAuthService.GetAccessToken(oauth_token, tokenSecret, oauth_verifier);

            var parameters       = new OAuthCheckTokenParameters(oauth_token);
            var checkTokenResult = _flickrApi.OAuthCheckToken(parameters);

            ViewBag.CheckTokenResponse = checkTokenResult;

            var getPhotoParameters = new GetPhotosParameters(userId: "27725019@N00")
                                     .PerPage(10);
            var flickrPhotosResult = _flickrApi.PeopleGetPhotos(getPhotoParameters);

            var oAuthModel = new OAuthModel
            {
                AccessToken      = accessToken,
                CheckTokenResult = checkTokenResult,
                Photos           = flickrPhotosResult,
            };

            return(View(oAuthModel));
        }
Exemple #2
0
        public void ShouldGetRequestToken()
        {
            var requestToken = _oAuthService.GetRequestToken(_callbackUrl);

            Assert.IsNull(requestToken.OAuthProblem);
            Assert.IsTrue(requestToken.OAuthCallbackConfirmed);

            Console.WriteLine("token:  {0}\nsecret: {1}", requestToken.OAuthToken, requestToken.OAuthTokenSecret);

            var checkTokenResponse = _flickrApi.OAuthCheckToken(new OAuthCheckTokenParameters(requestToken.OAuthToken));
        }