Comments (4)
app.get('/auth/google',
passport.authenticate('google', { scope: scope }),
function(req, res) {
/* do nothing as this request will be redirected to google for authentication */
}
);
from passport-google-oauth2.
I'm getting this same error, and I can't find answers anywhere. I'm passing the desired scope to passport.authenticate(), as described by @toadkicker. Here is the line in my app:
api.get('/auth/google', passport.authenticate('google', { scope: auth.google.scope }));
If I change the desired scope, it is reflected on the deny/allow page, so it seems the scope is being sent. The error shows up after Allow is selected.
Any help would be greatly appreciated.
from passport-google-oauth2.
Figured I should add the return route also.
api.get('/auth/google/return', passport.authenticate('google', { failureRedirect: '/hello/fail', successRedirect: '/hello/succeed' });
Seems this is actually where the error is occurring. If I comment out that line, the request comes back from Google to '/auth/google/return'. So, is Passport redirecting back to the Google error page?
from passport-google-oauth2.
Forgot to come back here. Seems it was an issue with the way I was setting up my Restify server. I was able to fix this by adding the following code after initializing the server:
api.use(restify.plugins.queryParser({ mapParams: false }));
Once I added that line, I no longer saw the Google error, and the process passed back to my code.
from passport-google-oauth2.
Related Issues (20)
- res.setHeader is not a function in NestJS (Express Adapter), GraphQL
- i can't get gender, birth of user HOT 1
- Typescript solution for force refresh token retrival
- userProfileURL is not working HOT 15
- Youtube Scope Doesnt Work
- GitHub title should read 20? HOT 9
- localhost refused to connect. HOT 6
- `node-oauth` throws intermittent InternalOAuthErrors on fast connections HOT 13
- query on google+ authentication
- How to use it in using ES6 modules HOT 2
- Best practice to authenticate Using Passport and passport-google-oauth2 without using any type of session? HOT 4
- Infinite loop occurred while connecting to the passport-google-oauth2 for "Sign in with Google". HOT 2
- Can't persist data to session store inside of GoogleStrategy callback HOT 2
- Refresh token not received and other problems HOT 5
- ERR_HTTP_HEADERS_SENT Error in Passport Google OAuth 2.0 Authentication HOT 1
- passport.serializeUser never gets called HOT 1
- is there any way to implement multiStrategy like passport saml MultiSamlStrategy
- syntax error at or near "AND"
- Passport google oauth20 failed to authenticate with PKCE enabled HOT 2
- TypeError: OAuth2 is not a constructor dependency error HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from passport-google-oauth2.