Skip to content

Commit

Permalink
Merge pull request #64 from mcastany/update-saml-response
Browse files Browse the repository at this point in the history
Updated saml response and test
  • Loading branch information
sandrinodimattia authored Nov 17, 2017
2 parents c974d64 + 7c10466 commit 749f3f3
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 12 deletions.
11 changes: 6 additions & 5 deletions test/fixture/samlp-server.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ passport.use('samlp', new Strategy({
identityProviderUrl: identityProviderUrl,
thumbprints: ['5ca6e1202eafc0a63a5b93a43572eb2376fed309'],
recipientUrl: 'https://auth0-dev-ed.my.salesforce.com',
destinationUrl: 'https://auth0-dev-ed.my.salesforce.com'
destinationUrl: 'https://auth0-dev-ed.my.salesforce.com'
}, function(profile, done) {
return done(null, profile);
})
Expand Down Expand Up @@ -208,11 +208,12 @@ function pemToCert(pem) {
passport.use('samlp-with-utf8', new Strategy(
{
path: '/callback',
thumbprints: ['42FA24A83E107F6842E05D2A2CA0A0A0CA8A2031'],
decryptionKey: fs.readFileSync(path.join(__dirname, '../test-decryption.key')),
recipientUrl: 'https://fmi-test.auth0.com/login/callback',
destinationUrl: 'https://fmi-test.auth0.com/login/callback',
thumbprints: ['119B9E027959CDB7C662CFD075D9E2EF384E445F'],
decryptionKey: fs.readFileSync(path.join(__dirname, '../test-auth0.key')),
recipientUrl: 'https://login0.myauth0.com/login/callback',
destinationUrl: 'https://login0.myauth0.com/login/callback',
checkExpiration: false, // we are using a precomputed assertion generated from a sample idp feide
checkSPNameQualifier: false,
checkAudience: false
},
function(profile, done) {
Expand Down
12 changes: 6 additions & 6 deletions test/samlp.functional.tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ var Saml = require('../lib/passport-wsfed-saml2/saml').SAML;

describe('samlp (functional tests)', function () {
const samlRequest = fs.readFileSync(path.join(__dirname, './samples/encoded/samlrequest_signed_differentcert.txt')).toString()

before(function (done) {
server.start(done);
});
Expand Down Expand Up @@ -178,7 +178,7 @@ describe('samlp (functional tests)', function () {

describe('SAMLResponse with utf8 chars (default encoding not configured)', function () {
var user, r, bod, $;

before(function (done) {
request.post({
jar: request.jar(),
Expand All @@ -200,15 +200,15 @@ describe('samlp (functional tests)', function () {
it('should return a valid user', function(){
var user = JSON.parse(bod);
expect(user['http://schemas.xmlsoap.org/ws/2005/05/identity/claims/nameidentifier'])
.to.equal('_89841b346092548fd44097a1e7c426a4');
.to.equal('_98f3625b1c12bdbda1842b868eee10cdb61385b270');
expect(user['urn:oid:2.5.4.4'])
.to.equal('Müller');
.to.equal('Doë');
});
});

describe('SAMLResponse with ISO-8859-1 chars (default encoding not configured)', function() {
var user, r, bod, $;

before(function (done) {
const samlxml = fs.readFileSync(path.join(__dirname, './samples/plain/samlresponse_explicit_iso.txt')).toString();
const samlEncoded = new Buffer(samlxml, 'binary').toString('base64');
Expand Down Expand Up @@ -241,7 +241,7 @@ describe('samlp (functional tests)', function () {

describe('SAMLResponse with ISO-8859-1 chars (default encoding configured)', function() {
var user, r, bod, $;

before(function (done) {
const samlxml = fs.readFileSync(path.join(__dirname, './samples/plain/samlresponse_iso.txt')).toString();
const samlEncoded = new Buffer(samlxml, 'binary').toString('base64');
Expand Down
Loading

0 comments on commit 749f3f3

Please sign in to comment.