passport-openidconnect icon indicating copy to clipboard operation
passport-openidconnect copied to clipboard

oidc discovery well-known

Open salleman33 opened this issue 4 years ago • 2 comments

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

salleman33 avatar May 06 '20 20:05 salleman33

I went through the same issue. You have to mention the userInfoURL as well.

jonathangaldino avatar May 21 '20 19:05 jonathangaldino

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 🤷‍♂️

sorokya avatar May 13 '22 16:05 sorokya