GithubHelp home page GithubHelp logo

Comments (6)

benheymink avatar benheymink commented on June 3, 2024 4

Late to the party, but take a look at passports: https://www.npmjs.org/package/passports

from passport-saml.

ploer avatar ploer commented on June 3, 2024

So, the issue is that you have many users with many different identity providers, some of which are different accounts at onelogin, and you need to be able to dispatch to the appropriate identity provider based on some property of the user?

passport-saml is oriented around providing a strategy to authenticate users against one identity provider. If you have multiple identity providers I think you want multiple instances of the passport-saml strategy, and then maybe a middleware wrapper around your passport.authenticate call that dispatches to the appropriate strategy based on your application logic.

from passport-saml.

apriendeau avatar apriendeau commented on June 3, 2024

So we are only looking to support onelogin but since they generate a random url, like https://app.onelogin.com/trust/saml2/http-post/sso/{{random_id_generated}}; How do you add that without it being dynamic? So if I have two different companies that are using onelogin. If I can add it to .authenticate(), how would you use suggest that we go about that?

from passport-saml.

ploer avatar ploer commented on June 3, 2024

Well, I'm not sure I'd call it random, it's just that each company using onelogin as an identity provider has a different id, right? So as part of each company that wants to set up onelogin as their identity provider for you, they need to give you that entrypoint. It may be all at onelogin but it is still multiple identity providers.

So one way I can think of to handle this (not sure if its the best way or not), would be to register multiple strategies for each comany, i.e. passport.use('saml-foo-company', samlStrategy1); passport.use('saml-bar-company', samlStrategy2);, and then instead of putting passport.authenticate in the middleware chain for your route, something like:

function authenticateWithAppropriateIdentityProvider(res, req, next) {
   if (userIsWithFooCompany)
    passport.authenticate('saml-foo-company')
  else if (userIsWithBarCompany)
    passport.authenticate('saml-bar'company')
  ...
}

from passport-saml.

ploer avatar ploer commented on June 3, 2024

Nice, that looks like just the thing.

from passport-saml.

apriendeau avatar apriendeau commented on June 3, 2024

perfect. Thank you.

from passport-saml.

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.