randalvance / aws-lambda-saml-authorizer

Example for AWS Lambda Integration with a SAML-based identity provider.
7 stars 5 forks source link

saml2 not supported? #8

Open dynnamitt opened 1 year ago

dynnamitt commented 1 year ago

got an error when testing against aws-SSO (IIDC) the assertion dump from console.dir() is ` {

'saml2p:Response': { ': { 'xmlns:saml2p': 'urn:oasis:names:tc:SAML:2.0:protocol', 'xmlns:ds': 'http://www.w3.org/2000/09/xmldsig#', 'xmlns:enc': 'http://www.w3.org/2001/04/xmlenc#', 'xmlns:saml2': 'urn:oasis:names:tc:SAML:2.0:assertion', Destination: 'https://xxxxxxxxxxxxxxx.execute-api.eu-west-1.amazonaws.com/dev/saml', ID: '_bbb-b8ce-4033-a57e-6f9a96055ee2', IssueInstant: '2022-11-28T20:20:11.699Z', Version: '2.0' }, 'saml2:Issuer': [ [Object] ], 'ds:Signature': [ [Object] ], 'saml2p:Status': [ [Object] ], 'saml2:Assertion': [ [Object] ] } } `

ypeError: Cannot read properties of undefined (reading 'saml:Assertion') at extractUserInfo (/var/task/functions/postSaml.js:21:29)

dynnamitt commented 1 year ago

in truth I skipped the sts step and just did console.dir() then onto the func that fails https://github.com/dynnamitt/aws-lambda-saml-authorizer/blob/cmp-ver/serverless/functions/postSaml.js#L52