Token rejected problem in auth flow.
Closed this issue · 4 comments
I direct user to the URL generated by
flickr.get_request_token :oauth_callback => flickr_callback_image_import_url
After authorizing user is sent to this callback action
def flickr_callback
token = FlickRaw::Flickr.new.get_request_token :oauth_callback => flickr_callback_image_import_url
raw_token = flickr.get_access_token(token['oauth_token'], token['oauth_token_secret'], params[:oauth_verifier])
end
I get a 'token rejected' response from the flickr.get_access_token
call every time. Can someone point me towards what I am doing wrong? I'd really appreciate it.
Hello trafnar,
Please look at the example with sinatra : https://github.com/hanklords/flickraw/blob/master/examples/sinatra.rb
At first glance in your code, it seems you should not do a get_request_token
before get_access_token
.
Thanks for your response. In the Sinatra example get_request_token
is called initially and stored in the session before the callback is executed which runs get_access_token
using the token generated previously by get_request_token
. Am I misunderstanding something there?
The process is :
get_request_token
get_authorize_url
get_access_token
Did you try the offline method (without a callback) described in the README and in auth.rb ?
Thanks for your help. I was able to get authentication to work.