question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

XSD validation problem

See original GitHub issue

Hi there, first of all great work in this lib.

I’m create a SAML integration where my application will be and IdP and the login should be initiated by the IdP.

Curretly these are my settings for the Idp and SP

const identityProvider = saml.IdentityProvider({ entityID: 'flex-idp', singleSignOnService: [{ Binding: 'urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect', Location: 'http://localhost:8080/api/auth/sso/login', }], singleLogoutService: [{ Binding: 'urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect', Location: 'http://localhost:8080/api/auth/sso/logout', }], privateKey: '-----BEGIN PRIVATE KEY-----\n' signingCert: '-----BEGIN CERTIFICATE-----\n' ', });

const serviceProvider = saml.ServiceProvider({ entityID: 'apex', privateKey: '-----BEGIN PRIVATE KEY-----\n' signingCert: '-----BEGIN CERTIFICATE-----\n' assertionConsumerService: [ { Binding: 'urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect', Location: 'https://www.apexvs.com/APEXUI/Saml/AssertionConsumerService.aspx' }, { Binding: 'urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST', Location: 'https://www.apexvs.com/APEXUI/Saml/AssertionConsumerService.aspx' } ], loginNameIDFormat: 'persistent', });

So the workflow starts with a login request const { id, context } = serviceProvider.createLoginRequest(identityProvider, 'redirect'); return response.redirect(context);

then I have another endpoint that handles the login request const parsedRequest = await identityProvider.parseLoginRequest(serviceProvider, 'redirect', request); await identityProvider.createLoginResponse(serviceProvider, parsedRequest, 'post', request.user);

But when I try to create a login response I’m getting an error with xsd namespaces

Error: Cannot resolve QName samlp at Function.NodeTest.nameSpaceMatches (/Users/freitasjuciel/development/repo/flexmajor/flex-major-school-api/node_modules/xpath/xpath.js:2311:15) at Object.matches (/Users/freitasjuciel/development/repo/flexmajor/flex-major-school-api/node_modules/xpath/xpath.js:2337:16) at Function.PathExpr.applyStep (/Users/freitasjuciel/development/repo/flexmajor/flex-major-school-api/node_modules/xpath/xpath.js:1865:26) at /Users/freitasjuciel/development/repo/flexmajor/flex-major-school-api/node_modules/xpath/xpath.js:2046:67 at /Users/freitasjuciel/development/repo/flexmajor/flex-major-school-api/node_modules/xpath/xpath.js:139:40 at /Users/freitasjuciel/development/repo/flexmajor/flex-major-school-api/node_modules/xpath/xpath.js:124:3 at fn (/Users/freitasjuciel/development/repo/flexmajor/flex-major-school-api/node_modules/xpath/xpath.js:117:22)

Can you guys help me ? am I doing something wrong ?

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:15 (9 by maintainers)

github_iconTop GitHub Comments

2reactions
freitasjucielcommented, Jan 19, 2019

hey @tngan I was debuging the code and what solved my problem was chaging the referenceTagXPath from /samlp:Response/saml:Assertion to /*[local-name() = 'Response']/*[local-name() = 'Assertion'] and the signatureConfig.location.reference from /samlp:Response/saml:Assertion/saml:Issuer to /*[local-name() = 'Response']/*[local-name() = 'Assertion']/*[local-name() = 'Issuer']

is this problem related to the missing @passify/xsd-schema-validator ?

0reactions
tngancommented, Jun 25, 2019

I will close this issue first since there is no feedback for more than 3 months. Please reopen it if you have any further question.

Read more comments on GitHub >

github_iconTop Results From Across the Web

XSD validation error. "A Problem Was Found Starting At
The problem is, you haven't shown us the XML that you want to validate. It's hard to tell you what's wrong with incorrect...
Read more >
Problem with xsd validation - Oxygen XML Forum
Hi, The short story is this happens because you're importing a v1.1 XML schema in what is considered by Oxygen to be a...
Read more >
Understanding schema errors | HESA
The schema is defined by the XSD. Schema errors occur where there is a problem with the structure or order of the file,...
Read more >
KB5011564 causing XSD validation error - Microsoft Q&A
KB5011564 causing XSD validation error. We've started getting errors with our .NET service from 2 different systems owned by different ...
Read more >
XML-validation-against-external-XSD-fails-starting-with ...
Unexpected validation errors may occur when using X-DOCUMENT / DOM parser - XML nodes that are defined in XML Schema trigger errors. Or...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found