更新时间:2023-02-12 19:23:56
Finlay可以通过以下代码交换授权代码,以从cognito auth中检索access_token,刷新和id_token:
Finlay got the way to exchange Authorization code to retrieve the access_token along with the refresh and id_token from cognito auth with below code:
response = requests.post(url + '/oauth2/token',{'Content-Type':'application/x-www-form-urlencoded', 'grant_type': grant_type, 'client_id': App_client_id, 'code': code, 'redirect_uri': 'http://localhost:5000/login'})
print(response.json())
谢谢