{"_id":"saml2js","_rev":"5-e267ef0025180683b5bf32915f554933","name":"saml2js","description":"Parse SAML2 attributes into a JavaScript object.","dist-tags":{"latest":"0.1.2"},"versions":{"0.1.0":{"name":"saml2js","version":"0.1.0","description":"Parse SAML2 attributes into a JavaScript object.","main":"index.js","repository":{"type":"git","url":"https://github.com/Aplo/saml2js.git"},"keywords":["SAML","SAML2","parser","authentication"],"author":{"name":"Bill Patrianakos","email":"bill+opensource@aploquote.com"},"license":"MIT","bugs":{"url":"https://github.com/Aplo/saml2js/issues"},"dependencies":{"lodash":"^3.10.1","xmldom":"^0.1.16","xpath":"0.0.5"},"homepage":"https://github.com/Aplo/saml2js","devDependencies":{},"scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"gitHead":"58cc3618a2a3204c8fcc33c58d19ae7c3ba6fe7f","_id":"saml2js@0.1.0","_shasum":"03a45fa60c692c80806f3af7131972484a65a017","_from":".","_npmVersion":"2.5.1","_nodeVersion":"0.12.0","_npmUser":{"name":"billpatrianakos","email":"bill@aploquote.com"},"dist":{"shasum":"03a45fa60c692c80806f3af7131972484a65a017","tarball":"https://registry.npmjs.org/saml2js/-/saml2js-0.1.0.tgz","integrity":"sha512-7/LvW/BBH4n1PYpSY4ejxI8uh/+OggljvSXS2xoJtpIAxZ+fg71bgznYHe3+PuEzeAgh1aIl2KxcrxV8PaukEg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICaa6kUKynisfl4Kv7VztskoPZSFk7RFJwxg9DZ26G2sAiEAuLPo7skeP6drT8P8JDzM4/utYPMPzjGxILZD5L08Mqs="}]},"maintainers":[{"name":"billpatrianakos","email":"bill@aploquote.com"}]},"0.1.1":{"name":"saml2js","version":"0.1.1","description":"Parse SAML2 attributes into a JavaScript object.","main":"index.js","repository":{"type":"git","url":"https://github.com/Aplo/saml2js.git"},"keywords":["SAML","SAML2","parser","authentication"],"author":{"name":"Bill Patrianakos","email":"bill+opensource@aploquote.com"},"license":"MIT","bugs":{"url":"https://github.com/Aplo/saml2js/issues"},"dependencies":{"lodash":"^3.10.1","xmldom":"^0.1.16","xpath":"0.0.5"},"homepage":"https://github.com/Aplo/saml2js","devDependencies":{"chai":"^3.2.0","grunt":"^0.4.5","grunt-contrib-jshint":"^0.11.2","grunt-contrib-watch":"^0.6.1","jshint-stylish":"^2.0.1","load-grunt-tasks":"^3.2.0","mocha":"^2.2.5","time-grunt":"^1.2.1"},"scripts":{"test":"./node_modules/mocha/bin/mocha"},"gitHead":"13233b5b0e19b7460780c6252066c9b5f7a40fb0","_id":"saml2js@0.1.1","_shasum":"bfba3a3a47fb57de113d72ebefe4694451b311d1","_from":".","_npmVersion":"2.5.1","_nodeVersion":"0.12.0","_npmUser":{"name":"billpatrianakos","email":"bill@aploquote.com"},"dist":{"shasum":"bfba3a3a47fb57de113d72ebefe4694451b311d1","tarball":"https://registry.npmjs.org/saml2js/-/saml2js-0.1.1.tgz","integrity":"sha512-ojhx/Pu3+cgLk14DItyYy5Hu8dOTHDl9dzpRf/h/pmoJq8xyjdGFGTyaktoSvbnJEAgb3lF+wVRsH6lvVtLldg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIH8/r5sT2PiQLr52ZBpuJAgE2U+WyxNhCYRTB9EhePRlAiEA/Bx5M7+E43NtXwyo1/Wu9R3WhELgezDcPjzLvHXQ3rE="}]},"maintainers":[{"name":"billpatrianakos","email":"bill@aploquote.com"}]},"0.1.2":{"name":"saml2js","version":"0.1.2","description":"Parse SAML2 attributes into a JavaScript object.","main":"index.js","repository":{"type":"git","url":"https://github.com/Aplo/saml2js.git"},"keywords":["SAML","SAML2","parser","authentication"],"author":{"name":"Bill Patrianakos","email":"bill+opensource@aploquote.com"},"license":"MIT","bugs":{"url":"https://github.com/Aplo/saml2js/issues"},"dependencies":{"lodash":"^3.10.1","xmldom":"^0.1.16","xpath":"0.0.5"},"homepage":"https://github.com/Aplo/saml2js","devDependencies":{"chai":"^3.2.0","grunt":"^0.4.5","grunt-contrib-jshint":"^0.11.2","grunt-contrib-watch":"^0.6.1","jshint-stylish":"^2.0.1","load-grunt-tasks":"^3.2.0","mocha":"^2.2.5","time-grunt":"^1.2.1"},"scripts":{"test":"./node_modules/mocha/bin/mocha"},"gitHead":"9e2cde696c07a95678b87f6824542bfc027f18d5","_id":"saml2js@0.1.2","_shasum":"f97ed46f12e53c20304eb33b1d36b36388b2365b","_from":".","_npmVersion":"2.5.1","_nodeVersion":"0.12.0","_npmUser":{"name":"billpatrianakos","email":"bill@aploquote.com"},"dist":{"shasum":"f97ed46f12e53c20304eb33b1d36b36388b2365b","tarball":"https://registry.npmjs.org/saml2js/-/saml2js-0.1.2.tgz","integrity":"sha512-O5q+/D8IhLytEMTp9TOgrksX1+Ao0sHIiETtHMf3og6x45qQDQPXS7Yfm139o5wqXfC6FHxsdvM9lVjcXjwNbA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCHwe5eyTXLVRt6gTK3Pe4v5Ti3gyLHqvdjf9VH+dBWd0CIQDCiMzy1WSFUt3JdwuibXOIi3ArPes50oiy9vzuEQiJpw=="}]},"maintainers":[{"name":"billpatrianakos","email":"bill@aploquote.com"}]}},"readme":"# saml2js [![npm version](https://badge.fury.io/js/saml2js.svg)](http://badge.fury.io/js/saml2js) [![Build Status](https://travis-ci.org/Aplo/saml2js.svg?branch=master)](https://travis-ci.org/Aplo/saml2js)\n\n> Parses SAML responses into JS objects you can read and manipulate.\n\n## Install\n\n```\n$ npm install saml2js --save\n```\n\nSaml2js supports Node.js 0.10+ and iojs.\n\n[![NPM](https://nodei.co/npm/saml2js.png?downloads=true&downloadRank=true&stars=true)](https://nodei.co/npm/saml2js/)\n\n## Usage\n\nSaml2js was designed for use in any Node.js environment whether that's a web app or a standalone script.\n\n```js\nvar express = require('express')\n    Saml2js = require('saml2js'),\n    app     = express();\n\napp.post('/saml/callback/?', function(req, res, next){\n  var parser = new Saml2js(res.body.SAMLResponse);\n  res.json(parser.asObject());\n});\n\napp.listen(3000);\n```\n\n### Methods\n\n#### Constructor\n\nTo instantiate a new SAML parser:\n\n```js\nvar Saml2js = require('saml2js');\n\nvar parser = new Saml2js(SAMLResponse);\n```\n\nAfter passing your SAML response as a string to the constructor you now have access to the following methods.\n\n#### `toObject()`\n\nReturns the parsed SAML as a JavaScript object.\n\n```\nvar parsedObject = parser.asObject();\n```\n\nNote that if your SAML has attributes have a `Name` attribute that contains a string that is mixed case and contains spaces Saml2js will automatically camel case this name when it is added as a property on the resulting object.\n\n__Example:__\n\nGiven the following SAML...\n\n```xml\n<saml2:Attribute Name=\"First Name\">\n  <saml2:AttributeValue>John</saml2:AttributeValue>\n</saml2:Attribute>\n```\n\nThe resulting JavaScript object returned from `Saml2js().asObject()` will look like this:\n\n```js\n{\n  firstName: 'John'\n}\n```\n\n#### `toJSON()`\n\nReturns parsed SAML as a JSON string. Once you've instantiated the module and passed it raw SAML you can get its value as a JSON string with `parser.toJSON()`.\n\n#### `get()`\n\nReturns the value of a SAML attribute by name. The name you pass to this function should be the same as what the attribute value in your SAML is. For example, given this SAML:\n\n```xml\n<saml2:Attribute Name=\"First Name\">\n  <saml2:AttributeValue>John</saml2:AttributeValue>\n</saml2:Attribute>\n```\n\nTo get the value of `First Name` you would call it like this:\n\n```js\n// assuming you've instantiated the library as `parser` with `new Saml2js(SAMLResponse)`...\nvar firstName = parser.get('first name');\nconsole.log(firstName); //=> 'John'\n```\n\nYou don't need to worry about case sensitivity. Internally the Lodash `.camelCase()` method is called on the string you pass so when it is compared against the parsed SAML it will automagically match the name of the key as its stored internally if it exists.\n\n#### `parse()`\n\nThis is a private method. It is called internally when you pass your SAML to the constructor. You should never need to call this manually. See the source code if you want to know more about it.\n\n## Testing\n\nTesting requires Mocha and Chai.\n\n1. Clone the repository\n2. Run `npm install && npm install -g mocha`\n3. Finally, run `mocha`\n\n## Contributing\n\nWhen contributing, be sure to branch off of `develop` to get the latest changes. Contributions are welcome. Please try to write tests for your code so we can merge it in faster.\n\n## Credit\n\n*This is a fork of [saml2json](https://github.com/flesch/saml2json.git) by John Flesch. Thanks for your original work.*\n\n## License\n\n[The MIT License (MIT)](http://flesch.mit-license.org/)\n\nModified work Copyright (c) 2015 Aplo LLC, https://aploquote.com\nOriginal work Copyright (c) 2013 John Flesch, http://fles.ch\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n","maintainers":[{"name":"billpatrianakos","email":"bill@aploquote.com"}],"time":{"modified":"2022-06-26T15:45:42.906Z","created":"2015-08-27T00:34:40.117Z","0.1.0":"2015-08-27T00:34:40.117Z","0.1.1":"2015-08-28T01:15:46.040Z","0.1.2":"2015-09-05T02:12:54.277Z"},"homepage":"https://github.com/Aplo/saml2js","keywords":["SAML","SAML2","parser","authentication"],"repository":{"type":"git","url":"https://github.com/Aplo/saml2js.git"},"author":{"name":"Bill Patrianakos","email":"bill+opensource@aploquote.com"},"bugs":{"url":"https://github.com/Aplo/saml2js/issues"},"license":"MIT","readmeFilename":"README.md"}