-
-
Notifications
You must be signed in to change notification settings - Fork 347
Open
Description
Hi @jaredhanson, I see that the profile
params are empty for me, would be possible to populate that with the userInfo
endpoint?
Most of OAuth2 providers (keycloak for example) supports that endpoint.
I was thinking of something like this:
passport.use(new OAuth2Strategy({
authorizationURL: 'https://www.example.com/oauth2/authorize',
tokenURL: 'https://www.example.com/oauth2/token',
userInfo: "https://www.example.com/oauth2/userinfo",
clientID: EXAMPLE_CLIENT_ID,
clientSecret: EXAMPLE_CLIENT_SECRET,
callbackURL: "http://localhost:3000/auth/example/callback"
},
function(accessToken, refreshToken, profile, cb) {
console.log(profile) // output: {<...>}
User.findOrCreate({ exampleId: profile.id }, function (err, user) {
return cb(err, user);
});
}
));
I would like to make a PR request if that's fine for you.
guilhermewerner
Metadata
Metadata
Assignees
Labels
No labels