Unable to log in using Node.JS sample

Hi Everyone,

Strange issue occurring when trying to do the most basic of tasks. I am simply trying to login using express-openid-connect.

I am trying to use the node.js sample app. I am making no changes to the code other than inserting the config directly to app.use().

When I click the login link, a request is made, but it never finishes and gets a response or error. No login dialogue is shown, browser sits there spinning icon in the tab. There are no Auth0 logs so it isnt leaving my machine. Other sample apps work.

What am I doing wrong?

Thanks
Michael

config

const config = {
authRequired: false,
auth0Logout: true,
secret: ‘a long, randomly-generated string stored in env’,
baseURL: ‘http://localhost:3000’,
clientID: ‘8************************’,
issuerBaseURL: ‘https://*****.us.auth0.com’
};

This is the full code.

const express = require(‘express’);
const { auth } = require(‘express-openid-connect’);
require(‘dotenv’).config();
const app = express();
app.use(auth({
issuerBaseURL: process.env.ISSUER_BASE_URL,
baseURL: process.env.BASE_URL,
clientID: process.env.CLIENT_ID,
secret: process.env.SECRET
}));

app.get(‘/’, (req, res) => {
if (req.oidc.isAuthenticated()) {
res.send(hello ${req.oidc.user.sub});
} else {
res.send(‘Logged out login’);
}
});

app.listen(3000, () => console.log(‘listening at http://localhost:3000’))

Looking for the same Issue. Did you find any solution.

Update:
I managed to fix this issue by upgrading version of Node to LTS.

@jennyr.eed1995 can you confirm this works for you?

Thanks for your message.

No I was unable to get this to work. I had to use the old react-auth0 sample ****.

I had suspected it was a weird machine config issue, but it seems not. Is there noone who can validate the Auth0 official tutorial?

**** GitHub - auth0-samples/auth0-ionic-samples