Skip to content
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

Update docs/adfs/README.md and move to wiki #840

Merged
merged 4 commits into from May 29, 2023
Merged

Conversation

1nbuc
Copy link
Contributor

@1nbuc 1nbuc commented Jan 19, 2023

Description

  • Added Powershell command to activate signing on message and aseertion on AD FS in docs/adfs/README.md
  • Added Link to Microsoft Documentation with a list of all available authnContext options.

Checklist:

  • Issue Addressed: [ ]
  • Link to SAML spec: [ ]
  • Tests included? [ ]
  • Documentation updated? [X]

added necessary parameters for ADFS
added Microsoft reference for authnContext
@@ -57,6 +58,8 @@ passport.use(
racComparison: "exact", // default to exact RequestedAuthnContext Comparison Type
// From the metadata document
audience: "https://adfs.acme_tools.com/FederationMetadata/2007-06/FederationMetadata.xml",
// otherwise it will thow because of invalid document signature
wantAuthnResponseSigned: false,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't want any example code to disable security features.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But it is very confusing since this is the exact configuration for AD FS and not working out of the box.
If possible it could also be mentioned how to adjust the ADFS configuration to work with it but for me there was no other oppertunity than setting wantAuthnResponseSignedto false

@srd90
Copy link

srd90 commented Jan 19, 2023

AFAIK @markstos has proposed to move all IdP implementation specific guides to wiki section (like e.g. https://github.com/node-saml/passport-saml/wiki/How-to-use-with-Auth0 ) so this could be good moment to move ADFS specific guide also.

@1nbuc about the change that you proposed

+      // otherwise it will thow because of invalid document signature
+      wantAuthnResponseSigned: false,

and especially about this code comment:

// otherwise it will thow because of invalid document signature

it would be better to tell why this happens. Reason why this happens is that your IdP is signing only assertion. I.e. it does not sign whole authnresponse. Starting from 4.0.0 passport-saml was changed to require by default response and assertion signatures and it is up to developer to configure passport-saml to be compatible with how IdP is signing OR to (re-)configure IdP side.

I am not an ADFS user but based on quick web search it seems that it might be possible to configure ADFS to sign only assertion, only message or both. See e.g.:

So if your example is stating that ”otherwise you get invalid signature error” it might not be the case for someone else and in some case someone's ADFS might be configured to sign both in which case - when that someone has just copy pasted your example without understanding - his/her configuration would be less secure than what it could have been.

Having said all that this is not ADFS specific problem at all. It is related to how well developers know authentication protocol that they are using to secure their site. They should be aware of signatures and other security related aspects before implementing SAML and there are far better sites for that documentation than passport-saml project.

fwiw, there has been quite a few issues relating this new behaviour:

… on AD FS and removed insecure parameter in example
@srd90
Copy link

srd90 commented Jan 19, 2023

Forgot to mention that if someone's ADFS would have been configured to sign only message and that someone would have copy pasted proposed example configuration as-is then there would have been another issue about incorrect example configuration due signature validation error because assertion is not signed and passport-saml default for wantAssertionsSigned is true. I.e. IdP (ADFS) would be signing only message but copy pasted configuration would have effectively this configuration: wantAuthnResponseSigned = false and wantAssertionsSigned = true whereas in that particular case effective configuration should be wantAuthnResponseSigned = true and wantAssertionsSigned = false.

@1nbuc
Copy link
Contributor Author

1nbuc commented Jan 19, 2023

Honestly I didn't know about the possibility to change the signing behaviour, I added the powershell script to the docs and removed the insecure configuration.

cjbarth
cjbarth previously approved these changes Jan 19, 2023
@cjbarth
Copy link
Collaborator

cjbarth commented Jan 19, 2023

@1nbuc , for record-keeping purposes, can you please adjust the description of this PR to follow the directions?

@cjbarth cjbarth added the documentation Request for or contribution to documentation label Jan 19, 2023
@1nbuc 1nbuc changed the title Update README.md Update docs/adfs/README.md Jan 19, 2023
@cjbarth
Copy link
Collaborator

cjbarth commented May 29, 2023

This document has been moved to the Wiki.

@cjbarth cjbarth changed the title Update docs/adfs/README.md Update docs/adfs/README.md and move to wiki May 29, 2023
@codecov
Copy link

codecov bot commented May 29, 2023

Codecov Report

Merging #840 (6f9a2b0) into master (91b1ba6) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##           master     #840   +/-   ##
=======================================
  Coverage   65.10%   65.10%           
=======================================
  Files           4        4           
  Lines         149      149           
  Branches       37       37           
=======================================
  Hits           97       97           
  Misses         29       29           
  Partials       23       23           

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@cjbarth cjbarth merged commit 2d10c9a into node-saml:master May 29, 2023
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Request for or contribution to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants