Unknown authentication strategy "oidc" for OKTA sample code

Hi. I’m new to OKTA, so I’ve been following the tutorial for integrating OKTA SSO with Node.js. I cloned this github repo: GitHub - okta-samples/okta-express-sample: Node.js Express + Okta and follow the instruction in the README.md to install the dependencies.

When I open localhost:3000 and click on the login button, I got an error: Unknown authentication strategy “oidc”. I’m certain I ran npm install, so I’m confused about the error. Any help is appreciated

Hi there @VuLe ,

Welcome to the community!

I just wiped my clone of the okta-express-sample repo and started from scratch, and I am able to run the application. I did have a different problem with a requested scope that I’ll fix, but I didn’t see an oidc strategy error.

Let’s gut-check that the npm install was successful. Would you mind deleting your node_modules directory and installing dependencies again? Let’s see if it was a network glitch during the installation or if we have some more detective work to do.

Let us know how it goes!

Hi @alisaduncan,
The bug was due to me not running okta start express in the CLI. If I only clone the repo and run the npm commands it wouldn’t work.

My issue was misconfiguring my .okta.env file :see_no_evil: so when cloning the repo and running npm commands no need to add the dollar sign and brackets ${}.

So instead the file should be the following for the middleware to create the “oidc” strategy:

ORG_URL=OKTA_ORG_URL
CLIENT_ID=OKTA_CLIENT_ID
CLIENT_SECRET=OKTA_CLIENT_SECRET