Thursday, 8 June 2017

Auth0 middleware in nodejs (express) gives Error: aggrinfo ENOTFOUND

I'm using a middleware in my express API to validate against 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']
});

...

  server.use('/api', checkJwt, routes);

It works on my local dev-machine but when I run it in production I get:

Error: getaddrinfo ENOTFOUND undefined undefined:443
    at errnoException (dns.js:28:10)
    at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:76:26)

I'm running ubuntu 12 in production and mac on dev.



via Per Ström

No comments:

Post a Comment