Alexa技能链接

问题描述 投票:0回答:1

我有一个使用Python Flask定义的REST API,我想通过使用Alexa技能向该API发出http请求。

@app.route('/auth', methods=["POST"])
def auth_user():
    data = request.get_json()
    users = db.users
    logged_user = users.find_one({'username' : data["username"]})
    if logged_user is not None and bcrypt.check_password_hash(logged_user['password'], data['password']):
        access_token = create_access_token(identity=data["username"])
        return jsonify({'logged_user':logged_user,'access_token':access_token})
    else:
        return "Invalid password or username"

如您在上面看到的,我检查凭据是否正确,然后在响应中发送acess_token。然后,剩余端点要求jwt执行请求。

我如何使用Alexa技能来做到这一点?如何首先在API中使用户生效?

python flask jwt alexa
1个回答
0
投票

您需要在Amazon的注册用户和您的系统之间建立帐户链接。这是一个很大的话题。您可以在此处了解更多信息:https://developer.amazon.com/en-US/docs/alexa/account-linking/understand-account-linking.html

© www.soinside.com 2019 - 2024. All rights reserved.