-
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
Is it possible to get "WantAssertionsSigned = true" to work? #533
Comments
Thank you for your feedback about this feature. I don't believe we support this feature, particularly if you've already searched the code like you have. We aren't really in a position to implement features for others, but we do try to help others add the features correct and include them in this project. We typically start by asking that a link to the relevant part of the SAML spec be linked to. Then a test need to be written to validate that the feature currently doesn't work which asserts that it is working like it should after it is implemented. |
Hi @cjbarth, thank you for the quick reply. In case anybody else is looking for "WantAssertionsSigned" and stumbling upon this issue:
|
@HendrikJan Would you be willing to make a PR that includes the changes that you made so that they can end up in this code so you don't have to maintain a fork and so that others can benefit from your discovery? |
@cjbarth. What I did was fix the generated metadata after generating (so outside of passport-saml). function generateMetadata() {
const decryptionCrt = fs.readFileSync(samlConfig.saml_crt_file, 'utf8');
const metadata = samlStrategy.generateServiceProviderMetadata( // <-- here metadata is generated
decryptionCrt, // should match with samlStrategy:decryptionPvk
decryptionCrt // should match with samlStrategy:privateCert
);
let xml = '';
// Convert XML to JSON
xml2js.parseString(metadata, (err, result) => {
if (err) {
throw err;
}
// Add AuthnRequestsSigned to the metadata (as requested by ITS)
result.EntityDescriptor.SPSSODescriptor[0].$.AuthnRequestsSigned = 'true';
result.EntityDescriptor.SPSSODescriptor[0].$.WantAssertionsSigned = 'true'; // <-- here I add to metadata
// Convert JSON back to XML
const builder = new xml2js.Builder();
xml = builder.buildObject(result);
});
return xml;
} I'll try to read the code this weekend and see if I can create a PR, but I'm not sure I will succeed. |
Our IdP is requiring that we set
WantAssertionsSigned
to true in the metadata we send them.I did not find an option in the documentation to add
WantAssertionsSigned="true"
to the metadata when callinggenerateServiceProviderMetadata( decryptionCert, signingCert )
.I did not find the string "WantAssertionsSigned" anywhere in the code, so I assume this is not implemented.
Therefore I added it to the generated metadata this way:
I was hoping the assertions would be signed anyway and thus this would work out fine.
However, the IdP now returns "NotAuthorized", and testing with SimpleSamlPhp as IdP, we now get the error: "Unable to validate signature on query string."
Unfortunately I am not very experienced with SAML and so far not able to solve this myself.
Does the current version of passport-saml support signing assertions, and what configuration options should I set?
The text was updated successfully, but these errors were encountered: