-
-
Notifications
You must be signed in to change notification settings - Fork 387
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
help needed: using open-id-client with passport #12
Comments
got it reproduced |
Just for reference, my server file. 'use strict';
const Issuer = require('.').Issuer;
const Strategy = require('.').Strategy;
const app = require('express')();
const passport = require('passport');
const bodyParser = require('body-parser');
const cookieParser = require('cookie-parser');
const cookieSession = require('cookie-session');
Issuer.discover('https://guarded-cliffs-8635.herokuapp.com').then(function (issuer) {
return issuer.Client.register({
redirect_uris: ['http://lvh.me:3000/users'],
});
}).then(function (client) {
client.CLOCK_TOLERANCE = 5;
app.use(bodyParser.urlencoded());
app.use(cookieParser());
app.use(cookieSession({ secret: 'foo', resave: false, saveUnitialized: true, cookie: { secure: false } }));
passport.use('oidc', new Strategy(client, (tokenset, done) => {
console.log(tokenset);
return done(null, false);
}));
app.use(passport.initialize());
app.use('/users', passport.authenticate('oidc'), function (req, res) {
res.send('foo');
});
app.listen(3000);
}); |
When i run the server file above i get a state miss match. |
@floydprice too many moving pieces to tell what's wrong, are you getting a state back on your response? can you see it in the authorization response? |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
When I run my express app, I get this error:
TypeError: Cannot read property 'callbackParams' of undefined at OpenIDConnectStrategy.authenticate (../grant/node_modules/openid-client/lib/passport_strategy.js:63:31) at attempt (../grant/node_modules/passport/lib/middleware/authenticate.js:348:16)
I'm including code snippet from my app.js file:
The text was updated successfully, but these errors were encountered: