XSD validation problem
See original GitHub issueHi 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:
- Created 5 years ago
- Reactions:1
- Comments:15 (9 by maintainers)
Top GitHub Comments
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
?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.