我需要为我的Flask RESTful应用程序使用Autho0。Auth0有一个对视图函数使用requires_auth
修饰符的example。在
@app.route('/secured/ping')
@cross_origin(headers=['Content-Type', 'Authorization'])
@requires_auth
def securedPing():
return "All good. You only get this message if you're authenticated"
对于flaskrestful,我将add_resource
与Resource
类一起使用,而不是将{requires_auth
应用于Version
?在
flaskrestful文档描述了如何specify decorators for a resource。在
相关问题 更多 >
编程相关推荐