Error: Your appBaseUrl is missing

I’ve been following a tutorial which almost worked until I tried the login. It was using quite old modules so I’ve upgraded to latest @okta etc 2.0 and am now getting appBaseUrl is missing. I tried changing my oidc to:

const oidc = new ExpressOIDC({
  issuer: "https://dev-numbers.okta.com/oauth2/default",
  client_id: 'myid',
  client_secret: 'mysecret',
  appBaseUrl: 'http://localhost:3000/',
  scope: "openid profile",
  routes: {
    login: {
      path: "/users/login"
    },
    callback: {
      path: "/users/callback",
      defaultRedirect: "/dashboard"
    }
  }
});

To no avail. Can anyone suggest what I do?

Okm I seem to have stopped this. And I’m not sure why.
I tried commenting out the issuer - got the same error. That’s strange! Maybe I was in the wrong file?
Closed the terminal and opened a new one, tried npm start - BOOM! Error on the issuer. So I must have been in the wrong file, right? WRONG!
I fixed the issuer, thinking it’ll go back to the the appBaseUrl error. Nope, STILL the issuer!
Closed the terminal, new terminal, start and… it starts! Not actually tried it yet but it starts at least!

Hi, I have followed the quickstart and after properly setting the config getting this same error. Can someone please assist. Thanks.

I think there must be an issue with the latest version. I had this exact same issue. I was using the latest version of Okta.

I downgraded it to the following version, and my express-session as well, and this issue went away completely.

npm install @okta/oidc-middleware@1.0.2 express-session@1.15.6 --save
1 Like

Thanks it worked for me!