Iam following these steps https://secure.flickr.com/services/api/auth.oauth.html to implement oauth in my clojure prog.
Everything is working fine to step 3 with the following code. (printlns are just for checking the return values)
(def consumer-key "0000")
(def consumer-secret "0000")
(def consumer (oauth.client/make-consumer consumer-key
consumer-secret
"http://www.flickr.com/services/oauth/request_token"
"http://www.flickr.com/services/oauth/access_token"
"http://www.flickr.com/services/oauth/authorize"
:hmac-sha1))
(def request-token (oauth/request-token consumer "http://localhost:8080/authorize"))
(defn flickrauth []
(def auth-url (oauth/user-approval-uri consumer
(:oauth_token request-token)))
(println (str auth-url "&perms=write")))
After typing the auth-url to my my browser can authorize the access with write permissions.
(defn get-access-token [oauth-token verifier]
(println "CONSUMER: " consumer "REQ TOKEN: " oauth-token "verifier: " verifier)
In the following code i only got "oauth_problem=token_rejected, status 401". So i guess there is a problem with exchanging the request token for an access token...
(def access-token-response (oauth/access-token consumer
request-token
verifier))
(println "ACCESS TOKEN RESPONSE: " access-token-response)
Short summary... I get a request token and verifier, but in access-token-response is another oauth_token used..and i don't know why.
Thanks for any help and hint!