【发布时间】:2019-12-02 23:27:49
【问题描述】:
我在我的 Node.js 应用程序中使用 Auth0,但在尝试保护我的应用程序中的任何路由时,我遇到了 Insufficient scope 错误。
我找了好久,发现了一堆类似的问题,但是没找到解决办法。
基本上,在我的节点应用程序中,我必须按如下方式保护路由:
const checkScopes = jwtAuthz(['read:flights']);
但是,在添加中间件以保护我的路由时,我总是收到 Insufficient scope 错误:
app.get('/api/permission', checkJwt, checkScopes, (req, res) => {
res.send({
msg: 'Your access token AND PERMISSION was successfully validated!'
});
});
你能帮帮我吗?
【问题讨论】:
标签: node.js authentication auth0