This project has moved. For the latest updates, please go here.

OAuth Exception occurred: token_rejected

Topics: Developer Forum, Project Management Forum, User Forum
Apr 1, 2014 at 2:00 PM
Hello All,

I am using FlickrNet library as per the samples given. All goes well until now. I suddenly encountered following error and not sure what is the reason.

The remote server returned an error: (401) Unauthorized.
OAuth Exception occurred: token_rejected

Can anyone help me out what's wrong? As same code version is worked on QA server and error is occurred in localhost environment.
FlickrManager.ApiKey = "key"
        FlickrManager.SharedSecret = "secret"

        If Not IsPostBack Then

            If String.IsNullOrEmpty(Request.QueryString("oauth_token")) AndAlso String.IsNullOrEmpty(Request.QueryString("oauth_verifier")) Then

                Dim f As FlickrNet.Flickr = FlickrManager.GetInstance()
                Dim token As OAuthRequestToken = f.OAuthGetRequestToken(Request.Url.AbsoluteUri)

                RequestToken = token ' this is stored in "Session"

                Dim str As String = f.OAuthCalculateAuthorizationUrl(RequestToken.Token, AuthLevel.Write)

                ' RequestToken is retrieved from Session
                If FlickrAccessToken Is Nothing Then
                    Dim f As FlickrNet.Flickr = FlickrManager.GetInstance()
                    Dim accessToken As OAuthAccessToken = f.OAuthGetAccessToken(RequestToken, Request.QueryString("oauth_verifier"))
                    FlickrAccessToken = accessToken
                End If
            End If

        End If
Apr 1, 2014 at 8:24 PM