Passport Js status 400 invalid client ID

I am getting a message

message: Invalid Client ID

I double checked all my things in the dev page. any help is appreciated.

const Passport = require('passport');

const GoogleStrategy = require('passport-google-oauth20').Strategy;

const  twitchStrategy = require("@d-fischer/passport-twitch").Strategy;


const User = require('../models/user-models');

router.get('/twitch', passport.authenticate('twitch', {

    scope: "user_read"




// Step 2, Step 3 goes to Passport Setup.js

router.get('/twitch/redirect/' , passport.authenticate('twitch'), (req, res) =>{

    console.log("2 req" , req.user);




Passport.use (

    new twitchStrategy ({

//options for passport

        clientID: api_keys.Twitch_ID,

        clientSecret : api_keys.Twitch_Secret,

        callbackURL: '/auth/twitch/redirect/',


}, (accessToken, refreshToken, profile, done) => {

    console.log("5 profile " , profile);

    console.log("5b profile " ,;

   // done(null, profile);


    //callback from passport

  //check if user already exists in DB


        TwitchId: profile._json.sub

    }).then((currentUser) =>{



            // already in DB from before


            console.log("Current User is: " + currentUser);

            done(null, currentUser);


        else {


    new User ({


        TwitchId: profile._json.sub,

        service: 'Twitch'

    }).save().then((newUser) =>{


        console.log('new user has been created in db ' + newUser);

        done(null, newUser);






That would suggest that your ClientID is invalid.

Did you obtain one from and correctly copy/paste the value?

yes, i doubled checked the ID and generated a new secret.

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