Code Monkey home page Code Monkey logo

Comments (4)

panva avatar panva commented on May 18, 2024 3

My recommendation is, if you want to use passport - start fresh with a pure passport example. Then when you know how passport works and you want to connect it to an OIDC OP come back and

  1. discover the OP (Issuer)
  2. instantiate a Client off that OP (Issuer)
  3. pass it to the Strategy constructor
  4. register that Strategy instance with your passport.

from node-openid-client.

panva avatar panva commented on May 18, 2024

I'm confused about usage with passport.js and node-openid-provider.

I guess this is where your disconnect happens. The two aren't to be meshed together.

  • Passport.js (see the library's website) is a multi provider authentication library for a website.
  • A Strategy that i provide with openid-client is so that you can use any OpenID Connect Provider with your passport.js setup, i.e. next to facebook and local account signup.
  • You use these strategies against multiple providers and the passport lib makes it so that you just have one interface
  • There's nothing from passport that belongs to an OpenID Connect provider
  • oidc-provider is for when you want to be an OpenID Connect Provider for many Relying Parties.

So how and where do I require the openid-client passport Strategy?

Please see passport js usage documentation first.

Is there supposed to be a login view provided on the RP for each OP's passport strategy?

This makes 0 sense to me. Are you familiar with OpenID Connect actors and how they interact with one another?

from node-openid-client.

Johnpc123 avatar Johnpc123 commented on May 18, 2024

Thanks for replying ---

Okay, yes I think I'm familiar. .. but I'm simultaneously getting used to the differences between express and koa2 and my brain may have overheated.

The Open ID authentication flow I'm getting familiar with this illustration of how the OpenID Connect Actors interact.

and .. yes I do think I need to review the passport.js documentation further.

One detail could help me with my disconnect..

In the example authentication occurs on the OP. It does not use passport. It's a nice clean simple example. The node-oidc-client RP redirects (as needed) to the /auth view on the OP, again no passport.

But if I want to authenticate using a OP provider, FB / Twit / oidc-provider (whichever) to grant access to a restricted resource on my RP. To do that I'll use passport.js.

Do I require passport.js and the requisite Passport strategy in the app.js of my RP? because when I try to do that it tells me I have a circular reference?

Or, instead of editing the RP example, do I create a separate site and const Strategy = require('openid-client').Strategy; there in its app.js ? thus making an RP out of that site?

Apologies.. it's been quite confusing.

from node-openid-client.

Johnpc123 avatar Johnpc123 commented on May 18, 2024

Thanks for suggesting I take this approach!

from node-openid-client.

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.