-
Notifications
You must be signed in to change notification settings - Fork 477
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
Error: SAMLResponse is not valid base64-encoded XML #806
Comments
There doesn't seem to be any code changes in There has been changes in dependencies which are used to process authn response XML message. Line 53 in d5ab7be
to 3.2.4 'sLine 54 in 51f8e6b
Because See Especially fix introduced to Use SAML tracer to capture authn response and see whether it is well-formed XML message (but do NOT post any SAML messages from production environment to github or to any other forums). Another approach would be to write simple test program to test this functionality:
Example of test program would be something like this (untested example code snippet): // test with @xmldom/xmldom versions 0.7.5 ... 0.7.9
const xmldom = require(`@xmldom/xmldom');
const fooinput = "...base64encoded value i.e. value of SAMLResponse parameter...";
const xml = Buffer.from(fooinput, "base64").toString("utf8");
const doc = new xmldom.DOMParser().parseFromString(xml);
if (!Object.prototype.hasOwnProperty.call(doc, "documentElement"))
throw new Error("SAMLResponse is not valid base64-encoded XML"); BTW. you want to have version of |
In addition to the always helpful comments by @srd90 , I would also suggest that you use https://www.samltool.com/ to help you test the validity of your XML. Also, since there is nothing in the discussion you linked to, or in this open issue, about your previously working setup, nor any information about what debugging you've tried, I'm going to close this. If you post with more information, we'll reopen it. |
Discussed in #805
Originally posted by deeptiranjandrb November 8, 2022
I am getting below error in my project:
Error: SAMLResponse is not valid base64-encoded XML at SAML.validatePostResponseAsync (/Users/dbali00/Documents/pure_repos/customer-management-ui/node_modules/passport-saml/lib/node-saml/saml.js:562:23) at MultiSamlStrategy.authenticate (/Users/dbali00/Documents/pure_repos/customer-management-ui/node_modules/passport-saml/lib/passport-saml/strategy.js:80:18) at /Users/dbali00/Documents/pure_repos/customer-management-ui/node_modules/passport-saml/lib/passport-saml/multiSamlStrategy.js:28:32 at findProvider (/Users/dbali00/Documents/pure_repos/customer-management-ui/routes/api-config/passport.js:31:14) at Object.getSamlOptions (/Users/dbali00/Documents/pure_repos/customer-management-ui/routes/api-config/passport.js:37:9) at MultiSamlStrategy.authenticate (/Users/dbali00/Documents/pure_repos/customer-management-ui/node_modules/passport-saml/lib/passport-saml/multiSamlStrategy.js:21:23) at attempt (/Users/dbali00/Documents/pure_repos/customer-management-ui/node_modules/passport/lib/middleware/authenticate.js:369:16) at authenticate (/Users/dbali00/Documents/pure_repos/customer-management-ui/node_modules/passport/lib/middleware/authenticate.js:370:7) at Layer.handle [as handle_request] (/Users/dbali00/Documents/pure_repos/customer-management-ui/node_modules/express/lib/router/layer.js:95:5) at next (/Users/dbali00/Documents/pure_repos/customer-management-ui/node_modules/express/lib/router/route.js:137:13) at Route.dispatch (/Users/dbali00/Documents/pure_repos/customer-management-ui/node_modules/express/lib/router/route.js:112:3) at Layer.handle [as handle_request] (/Users/dbali00/Documents/pure_repos/customer-management-ui/node_modules/express/lib/router/layer.js:95:5) at /Users/dbali00/Documents/pure_repos/customer-management-ui/node_modules/express/lib/router/index.js:281:22 at Function.process_params (/Users/dbali00/Documents/pure_repos/customer-management-ui/node_modules/express/lib/router/index.js:335:12) at next (/Users/dbali00/Documents/pure_repos/customer-management-ui/node_modules/express/lib/router/index.js:275:10) at /Users/dbali00/Documents/pure_repos/customer-management-ui/server-csr-proxy.js:109:5
I am using version 3.2.0 and tried upgrading to 3.2.4 but still I am receiving the same error. Can somebody please help me with the issue?
The text was updated successfully, but these errors were encountered: