express-openid-connect: After callback, req.oidc.accessToken and req.oidc.user are undefined

Describe the problem

After authentication req.oidc returns undefined for all variables which include: req.oidc.accessToken and req.oidc.user. Upon investigation, I noticed my session always returns an empty object. What would cause it to be empty?

Here is my config:

const authRequestHandler = auth({
  issuerBaseURL: process.env.IDENTITY_URL,
  baseURL: process.env.BASE_URL,
  clientID: process.env.CLIENT_ID,
  clientSecret: process.env.CLIENT_SECRET,
  secret: process.env.COOKIE_SECRET,
  authRequired: false,
  idpLogout: true,
  routes: {
    callback: '/cb',
  },
  authorizationParams: {
    scope: 'openid profile',
    response_type: 'code',
  },
});

What was the expected behavior?

req.oidc.accessToken should have information on callback. appSession shouldn’t be blank.

Environment

  • Version of this library used: v2.4.0
  • Express Version: v4.17.1

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 18 (8 by maintainers)

Most upvoted comments

@adamjmcgrath Sorry for the delay. Yes you can close this issue. Thanks again for the help.