GitHub OAuth Application, OAuth2Strategy requires a clientID option


I’ve completed all the steps of this project, and am receiving this error when I try to run app.js

TypeError: OAuth2Strategy requires a clientID option

I’ve tried pasting the solution code into my app.js file, but get the same error.

The traceback of the error points to the line where the passport.use function begins:

passport.use(new GitHubStrategy({
callbackURL: “http://localhost:3000/auth/github/callback
(accessToken, refreshToken, profile, done) => {
return done(null, profile);

This gives me the feeling that it’s not seeing the GITHUB_CLIENT_ID that I’ve provided. I’ve tried pasting the ID with the <> that it started with, with single quotes, double quotes, and every other possibility I could think of.

I even tried pasting my client id from Github directly into this function, instead of trying to import it from the .env file.

Any other ideas I could try?


1 Like

Having the exact same issue! Tried everything and it doesn’t seem to be picking up the ID

1 Like

■■■■. Let me know if you figure anything out.

I had the same issue. I changed the first “ID” in
to be in capital.
Not “Id”.

Aha. That makes sense.

This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.