我有一个简单的 Python 服务器来验证 Google oauth2 id_tokens。当此代码执行时,它会引发错误AppIdentityError: Wrong recipient
:
def verify():
id_token = request.form['id_token']
status = {}
if id_token is not None:
try:
jwt = verify_id_token(id_token, config['google']['clientId'])
status['valid'] = True
status['jwt'] = jwt
except AppIdentityError:
status['valid'] = False
status['message'] = "Invalid id token"
pprint.pprint(status)
response = make_response(json.dumps(status))
response.headers['Content-Type'] = 'application/json'
return response
是什么AppIdentityError: Wrong recipient
意思,我该如何解决?