无效令牌不包含resource_ID(authorizationserverv1.0)PYTHON REQUESTS

时间:2017-09-10 06:02:56

标签: python api authentication python-requests

我正在尝试使用API​​,我可以通过使用主凭据获取临时访问令牌但无法访问API,我已尝试将令牌编码为base64但我得到相同的错误。

import requests
from oauthlib.oauth2 import BackendApplicationClient
from requests_oauthlib import OAuth2Session
client_id='Client ID'
client_secret='Client Secret'
#fetch Temporary access token
client = BackendApplicationClient(client_id=client_id)
oauth = OAuth2Session(client=client)
token = oauth.fetch_token(token_url='https://login.burning-glass.com/v2/oauth/token', client_id=client_id,client_secret=client_secret)
#get access_token
access_token=token['access_token']

#Access endpoint with temporary token.
headers={'Authorization':'Bearer '+access_token}

page = oauth.post('https://apis.burning-glass.com/v2.1/similarity/skills',headers=x)

print page.content

我得到了这个API响应:

{"error":"access_denied","error_description":"Invalid token does not contain resource id (authorizationserverv1.0)"}

我在这里缺少什么?

0 个答案:

没有答案