【发布时间】:2022-02-24 21:21:28
【问题描述】:
我在为 oauth 代码授予流生成授权 URI 时包含了“扩展”范围,但在刷新访问令牌时,在响应中我将范围作为“签名”。刷新访问令牌时如何获取具有扩展范围的刷新令牌。我已附加我的代码以从刷新令牌中获取访问令牌。
auth_string = "{0}:{1}".format(
DOCUSIGN_CLIENT_ID, DOCUSIGN_CLIENT_SECRET
)
auth_encoded_hash = b64encode(auth_string.encode("utf-8"))
auth_header = auth_encoded_hash.decode("utf-8")
url = "https://account-d.docusign.com/oauth/token"
headers = {
"Authorization": "Basic {0}".format(auth_header),
"Content-Type": "application/x-www-form-urlencoded",
}
body = {"grant_type": "refresh_token", "refresh_token": refresh_token}
_response = requests.post(url, data=body, headers=headers)
response = _response.json() # here I am getting scope as 'signature'
我对此的第二个后续问题,如果刷新令牌本身在刷新访问令牌时过期,我将在上面的响应中收到什么错误消息?
【问题讨论】:
标签: oauth-2.0 docusignapi