-
Notifications
You must be signed in to change notification settings - Fork 475
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Getting issuer
in getSamlOptions(request)
of MultiSamlStrategy
#439
Comments
The method is called before SAML instantiation, so all the parsing/decrypting and (get kind of request) are not yet available. It's up to the user to select the appropriate configuration based on the request object. Which could be what you've implemented (perfectly fine) or something even simpler like, the actual URL. What we do is have different endpoints per IDP so we can fetch the configurations based on URL params instead of parsing the SAML messages. |
Ok, so the reason |
I'm in the same situation here; I have an unverified SAMLResponse which I want to verify; however, I have multiple potential SAML IdP configurations which could be used to verify the response. Only one of the providers will actually verify the SAMLResponse (since the cert is unique), but I want to know which provider configuration I should return from I was hoping Passport could provide the TypeScript-ified version of the first answer here:
|
For anyone looking to solve this problem in a different way: look at using In If you set a Snippets:
|
@crossan007 that is a valid, spec-compliant way of using RelayState. RelayState is supposed to round-trip from the IdP untouched for just such a purpose. Or, redirecting after login, or whatever, it is your payload. |
Just to add a bit, as I am having the same issue. I'd be happy if we could still add support for this, but for now I am also parsing the SAMLResponse by myself |
Add support for what @tomer-amir ? We shouldn't be returning any information from an unverified SAML payload, so I'm not sure what other idea you had in mind for achieving what you're after. Feel free to post a suggestion here and we can see what might work. |
@cjbarth The library can either supply the unverified data or export the parsing method so we can extract the information ourselves. this way we would not need to parse the XML ourselves to fetch the data :) WDYT? :) Edit: I would also add this to the docs |
I don't have the whole flow fresh in my mind here, but I wonder if this would be a good opportunity to accept an optional callback method in the parameter sets that allows the developer to pre-process the unverified claim. This approach could provide contextual hints about the trustworthiness of the claim, and possibly allow for additional library-enforced safeguards. |
@crossan007 , please flesh out your ideas and post them here. I've reopened the issue. |
I should also add that if it is IdP-initiated flow, then you know the URL that the request is coming from, so you should pretty easily be able to pick which federation to use. I'm going to close this as it is no longer an open issue, but rather a request for features. If someone would like to add a feature, please feel free to open a discussion about that with a proposal and/or open a PR. |
Currently, there's
MultiSamlStrategy
withgetSamlOptions(request)
.The
request
is a generic Node.js HTTPIncomingMessage
.But why is it the only argument of
getSamlOptions()
?Isn't the point of
MultiSamlStrategy
existing to choose SAML config based on which SAML server requests authentication?If yes, then why isn't
issuer
available ingetSamlOptions()
?.Currently, we had to work around that via:
Also, other people @ssbrewster have pointed that out:
#373 (comment)
The text was updated successfully, but these errors were encountered: