Oauth Handshake Copy Error
I am trying to build a PoC with the API REST of Copy but I have a problem when I try to get the ACCESS TOKEN: Message: oauth_problem=signature_invalid&debug_sbs=GET&https%3
Solution 1:
I have been able to solve my own issue. The problem was the creation of a new consumer (I had one for the first step of the oauth handshake) and not using the oauth.Token provided by the library (I put the oauth_verifier and the oauth_token with a workaround)
The solution:
@app.route('/get_access_token')defget_access_token():
print"Get Access Token"try:
oauth_verifier = request.args['oauth_verifier']
oauth_token = request.args['oauth_token']
print oauth_token + " & " + oauth_verifier
token = oauth.Token(oauth_token, request_token_secret) # request_token_secret is global
token.set_verifier(oauth_verifier)
client = oauth.Client(consumer, token) #consumer is global
url = "https://api.copy.com/oauth/access"
resp, content = client.request(url, "GET")
print"Resp: ", resp
print"Content: ", content
return content
except Exception as e:
return e.message()
Post a Comment for "Oauth Handshake Copy Error"