Joe*_*Joe 5 linux node.js express auth0
我在Express API中使用中间件来针对auth0进行验证
const checkJwt = jwt({
// Dynamically provide a signing key based on the kid in the header and the singing keys provided by the JWKS endpoint.
secret: jwksRsa.expressJwtSecret({
cache: true,
rateLimit: true,
jwksRequestsPerMinute: 5,
jwksUri: `https://${process.env.AUTH0_DOMAIN}/.well-known/jwks.json`
}),
// Validate the audience and the issuer.
audience: process.env.AUTH0_AUDIENCE,
issuer: `https://${process.env.AUTH0_DOMAIN}/`,
algorithms: ['RS256']
});
Run Code Online (Sandbox Code Playgroud)
...
server.use('/api', checkJwt, routes);
Run Code Online (Sandbox Code Playgroud)
它可以在我本地的开发机器上运行,但是当我在生产环境中运行它时,我得到:
Error: getaddrinfo ENOTFOUND undefined undefined:443
at errnoException (dns.js:28:10)
at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:76:26)
Run Code Online (Sandbox Code Playgroud)
我在生产环境和Mac开发环境中运行ubuntu 12。