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

linkedin redirecting always failure url why? #76

Open
sukeerthimogallapalli opened this issue May 27, 2019 · 3 comments
Open

linkedin redirecting always failure url why? #76

sukeerthimogallapalli opened this issue May 27, 2019 · 3 comments

Comments

@sukeerthimogallapalli
Copy link

Hi everyone,
I define 2 { successRedirect: '/', failureRedirect: '/login', }. When I press Allow button and then my page redirect failureRedirect's url (/login). Why ?

router.get('/auth/linkedin/callback',
passportLinkedIn.authenticate('linkedin', { successRedirect: '/', failureRedirect: '/login' }), (error, req, res, next) => {
console.log()
})
passport.use(new LinkedInStrategy({
clientID: config.linkedin.clientID,
clientSecret: config.linkedin.clientSecret,
callbackURL: config.linkedin.callbackURL,
profileFields: [
"first-name",
"last-name",
"email-address",
"headline",
"summary",
"industry",
"picture-url",
"positions",
"public-profile-url",
"location"
],
scope: ['r_basicprofile', 'r_emailaddress'],
state: true,
passReqToCallback: true
}, function (req, accessToken, refreshToken, profile, done) {
console.log('profile---------------------------------------------------------------------------------------------------')
process.nextTick(function () {
return done(null, profile);
})
}))

@robechun
Copy link

Want to leave a note here for future users-- Looks like setting the field
state = true breaks functionality and therefore will always redirect to failureUrl

@eric573
Copy link

eric573 commented May 9, 2021

I can verify this behavior. We have to set state=false to make it work.

@codestergit
Copy link

Yes any solution??

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

No branches or pull requests

4 participants