jaredhanson / passport-openidconnect

OpenID Connect authentication strategy for Passport and Node.js.
https://www.passportjs.org/packages/passport-openidconnect/?utm_source=github&utm_medium=referral&utm_campaign=passport-openidconnect&utm_content=about
MIT License
188 stars 173 forks source link

CallbackURL gets called but no passport callbacks are being called #17

Open mithun-daa opened 8 years ago

mithun-daa commented 8 years ago

Any idea why my passport callback or my serializer/deserailizer are not being called at all? My provider is authenticating the user and sends a token back to my callback. I did change it to use form_post.

app.use(passport.initialize());
app.use(passport.session());

passport.serializeUser(function (user, done) {
    console.log('in serialize');
        done(null, user);
});

passport.deserializeUser(function (user, done) {
    console.log('in de-serialize');
    done(null, user);
});

passport.use(new OidcStrategy({
    authorizationURL: 'https://localhost:44316/identity/connect/authorize',
    tokenURL: 'https://localhost:44316/identity/connect/token',
    userInfoURL: 'https://localhost:44316/identity/connect/userinfo',
    clientID: 'mvc',
    clientSecret: 'secret',
    callbackURL: '/callback',
    responseType: 'id_token',
    scope: ['profile']
}, function (iss, sub, profile, done) {
    console.log('In callback 1');
    console.log(profile);
}));

The passport.use callback never gets invoked.

jonathangaldino commented 4 years ago

You should call app.use(passport.initialize()) after passport being configured, maybe?

mdelnegro-lennd commented 10 months ago

I have same issue