Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error 400: invalid_request Missing required parameter: redirect_uri #145

Open
nikhilanand07 opened this issue May 15, 2021 · 1 comment
Open
Labels
question Request for help or support

Comments

@nikhilanand07
Copy link

Hi i am getting this error when i am clicking on Login with google button.

This is the list of dependencies I am using in my project.

"dependencies": {
"ejs": "^3.1.6",
"express": "^4.17.1",
"nodemon": "^2.0.7",
"passport": "^0.4.1",
"passport-google-oauth20": "^2.0.0"
}

node - version : "1.0.0"

app.js file

`const express = require('express');
const authRoute = require('./route/auth_route');
const passportSetup = require('./config/passport-setup');

const app = express();

//using the authRoutes
app.use('/auth', authRoute)

app.set('view engine', 'ejs');

app.get("/", (req, res)=>{
res.render('home');
})

app.listen(3000, ()=>{
console.log("Server is now running on port 3000");
})`

passport-setup.js file

`const passport = require('passport');
const GoogleStrategy = require('passport-google-oauth20');
const keys = require('./keys');

passport.use(
new GoogleStrategy({
//passport google strategy
clientURL:'http://localhost:3000/auth/google/redirect',
clientID: keys.google.clientID,
clientSecret: keys.google.clientSecret
}, ()=>{
//passport callback function
})
)`

@jaredhanson jaredhanson added the question Request for help or support label Dec 26, 2021
@jaredhanson
Copy link
Owner

Could you post the authRoute code?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Request for help or support
Projects
None yet
Development

No branches or pull requests

2 participants