passport-openidconnect
passport-openidconnect copied to clipboard
oidc discovery well-known
Hi, I looked to configure oidc auth with discovery/dynamic config. I have the URL https://xxxxx/sp/.well-known/openid-configuration for that.
Here is my test :
const OidcStrategy = require('passport-openidconnect').Strategy;
passport.use('oidc', new OidcStrategy({
issuer: "https://xxxxxx/sp",
clientID: 'xxxx',
clientSecret: 'xxxx',
callbackURL: 'https://localhost:3000/authorization-code/callback',
scope: 'openid profile'
}, (issuer, sub, profile, accessToken, refreshToken, done) => {
console.log(profile);
return done(null, profile);
}));
But this error occured :
TypeError [ERR_INVALID_ARG_TYPE]: The "url" argument must be of type string. Received undefined
at validateString (internal/validators.js:117:11)
at Url.parse (url.js:159:3)
at Object.urlParse [as parse] (url.js:154:13)
at new Strategy (/tmp/myapp/node_modules/passport-openidconnect/lib/strategy.js:40:60)
at Object.<anonymous> (/tmp/myapp/app.js:21:22)
Do you have an idea or a working example ?
Thanks
I went through the same issue. You have to mention the userInfoURL as well.
Well the maintainer totally removed discovery so I guess this can be closed. I'll be using openid-client
to do discovery and feed the config into OpenIdConnectStrategy 🤷♂️