LinkedIn JS API Token Exchange with REST Token

I am using python python-oauth2. I get an error when trying to exchange tokens. Here is the code snippet:

consumer = oauth.Consumer(consumer_key, consumer_secret)

client = oauth.Client(consumer)

client.request(access_token_url, "POST", headers={'xoauth_oauth2_access_token':'XXXXXXXXXX'})
({'status': '400', 'content-length': '83', 'transfer-encoding': 'chunked', 'vary': 'Accept-Encoding', 'server': 'Apache-Coyote/1.1', '-content-encoding': 'gzip', 'date': 'Thu, 10 May 2012 22:28:38 GMT', 'nncoection': 'close', 'content-type': 'application/x-www-form-urlencoded;charset=UTF-8', 'www-authenticate': 'OAuth realm="https%3A%2F%2Fapi.linkedin.com", oauth_problem="parameter_absent", oauth_parameters_absent="oauth_token%26oauth_verifier"'}, 'oauth_problem=parameter_absent&oauth_parameters_absent=oauth_token%26oauth_verifier')

He receives a response from 400:

oauth_problem="parameter_absent", oauth_parameters_absent="oauth_token%26oauth_verifier"

I cannot get auth_verifier because it is a JSAPI exchange for REST. Is there anything else to call?

+3
source share
1 answer

You do not pass xoauth_oauth2_access_token as a header, but a request parameter.

0
source

All Articles