1

当我尝试运行以下内容时:

from authlib.integrations.requests_client import OAuth2Session

APPCLIENTID=os.getenv('AppClientId')
APPCLIENTSECRET=os.getenv('AppClientSecret')
USERNAME2=os.getenv("Username2")
PASSWORD2=os.getenv("Password222")
scope = 'openid email profile'
token_endpoint = 'https://api-product-test99.auth.eu-west-1.amazoncognito.com/oauth/token'

client = OAuth2Session(APPCLIENTID, APPCLIENTSECRET, scope=scope) #, redirect_uri="https://localhost/callback"

ar = 'https://localhost/callback?code=xxxxxx&state=xxxxx'

token = client.fetch_token(token_endpoint, authorization_response=ar)
print(token)

我收到消息: json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

我只是按照 Authlib 页面上的示例进行操作。

我错过了什么吗?

4

0 回答 0