Coder Social home page Coder Social logo

Comments (12)

swiftone avatar swiftone commented on August 18, 2024

Thanks for the report, @mayankgupta0510 - I'm not aware of an existing issue that matches what you describe, but we'll take a look and see if we can reproduce.

from okta-oidc-js.

swiftone avatar swiftone commented on August 18, 2024

Internal ref: OKTA-341568

from okta-oidc-js.

mayankgupta0510 avatar mayankgupta0510 commented on August 18, 2024

Sorry i think , i didnt explain the problem properly, so let me explain actual issue here -> i am using oidc-middleware -> version 4.0.1 and my code snippet is

const oidc = new ExpressOIDC({
issuer: ias_serv.credentials.url,
client_id: ias_serv.credentials.clientId,
client_secret: ias_serv.credentials.Secret,
appBaseUrl: domainURL,
scope: "openid",
loginRedirectUri: domainURL + "/login/callback",
response_type: "code",
response_mode: "form_post",
});

app.use(
	session({
		secret: "dummy-cookie-secret",
		resave: true,
		saveUninitialized: false,
	})
);

app.use(oidc.router);

app.use(function (req: any, res: any, next: Function) {
	if (!req.userContext && req.url == "/") {
		console.log("login");
		res.redirect("/login");
		return;
	} else {
		app.use("/", routes);
	}
	next();
});

app.get("/login", oidc.ensureAuthenticated());

app.get("/login/callback", (req, res, next) => {
	res.redirect("/home");
	next();
});

const port = process.env.PORT || 3000;
oidc.on("ready", () => {
	app.listen(port, () => {
		console.log("We are live on " + port);
	});
});

after successfully authentication it redirects to /login/callback and it gives an error stating "done is not a function" from oidcUtils.bootstrapPassportStrategy line 91.

TypeError: done is not a function
at OpenIDConnectStrategy._verify (/Users/i077549/Documents/GitHub/CP-Home/node_modules/oidc-middleware/src/oidcUtil.js:91:9)
at /Users/i077549/Documents/GitHub/CP-Home/node_modules/oidc-middleware/node_modules/openid-client/lib/passport_strategy.js:172:10
at processTicksAndRejections (internal/process/task_queues.js:97:5)

from okta-oidc-js.

mayankgupta0510 avatar mayankgupta0510 commented on August 18, 2024

i believe there is already PR raised for this issue #372,
to update oidcUtil to allow a callback without userinfo

Currently my IDP only supports scope "openid" so incase if we don't have userinfo then it gives above error.

can you please confirm whether this fix is valid or not ?

from okta-oidc-js.

robertjd avatar robertjd commented on August 18, 2024

HI @mayankgupta0510 , we have this on our board to look at next week, including reviewing the PR above. Are you blocked while we investigate or have you been able to workaround by using the code in the PR? Thanks!

from okta-oidc-js.

mayankgupta0510 avatar mayankgupta0510 commented on August 18, 2024

Hi Robert,
Actually I am totally block with this issue, I am able to use the above PR code but I cannot use that for my production code.
Please can you take up this on priority, we have our Dev close on 4th November.

Thanks,
Mayank

from okta-oidc-js.

mayankgupta0510 avatar mayankgupta0510 commented on August 18, 2024

Hello Team, Robert,

any updates on this please?

from okta-oidc-js.

aarongranick-okta avatar aarongranick-okta commented on August 18, 2024

@mayankgupta0510 I am reviewing the code changes. So far they look good and we should be able to get them integrated. If I understand the issue properly, it is that your IDP does not support the "profile" scope which would normally provide the userinfo? And without the userinfo object, the number of parameters is changed, leading to this error.

from okta-oidc-js.

mayankgupta0510 avatar mayankgupta0510 commented on August 18, 2024

"it is that your IDP does not support the "profile" scope which would normally provide the userinfo? And without the userinfo object, the number of parameters is changed, leading to this error."

Mayank >> Yes that's exactly the problem.
could you please let me know in which release version or beta version this fix will be available since we are waiting for this fix for our release.

from okta-oidc-js.

mayankgupta0510 avatar mayankgupta0510 commented on August 18, 2024

Hello,
can you please let me know when will you release this fix?

from okta-oidc-js.

oleksandrpravosudko-okta avatar oleksandrpravosudko-okta commented on August 18, 2024

hello @mayankgupta0510 - I am getting #372 ready to merge - it should be good to go in the next few days
the release date have not been set yet but it is likely to happen soon

from okta-oidc-js.

oleksandrpravosudko-okta avatar oleksandrpravosudko-okta commented on August 18, 2024

@mayankgupta0510 - FYI, fix has been released in v4.0.2

from okta-oidc-js.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.