{"_id":"7pass-node-sdk","_rev":"18-be47c807f37ec9424d243c780feb29fe","name":"7pass-node-sdk","description":"7Pass SDK for Node.js","dist-tags":{"latest":"2.0.1"},"versions":{"1.0.0":{"name":"7pass-node-sdk","version":"1.0.0","description":"7Pass SDK for Node.js","main":"src/index.js","scripts":{"test":"NODE_ENV=test node_modules/.bin/_mocha","test-ci":"NODE_ENV=test node_modules/.bin/_mocha -R mocha-teamcity-reporter","coverage-ci":"NODE_ENV=test node_modules/.bin/istanbul cover --report teamcity node_modules/.bin/_mocha"},"author":{"name":"7Pass Development Team"},"license":"MIT","repository":{"type":"git","url":"git+ssh://git@github.com/p7s1-ctf/7pass-nodejs-sdk.git"},"devDependencies":{"chai":"^3.2.0","grunt":"^0.4.5","grunt-available-tasks":"^0.6.0","grunt-contrib-jshint":"^0.11.3","grunt-jscs":"^2.1.0","istanbul":"^0.3.22","lodash":"^3.10.1","mocha":"^2.3.2","mocha-teamcity-reporter":"^1.0.0","nock":"^2.13.0","sinon":"^1.17.1"},"dependencies":{"async":"^1.4.2","base64url":"^1.0.4","crypto":"0.0.3","joi":"^6.9.0","jsonwebtoken":"^5.4.0","superagent":"^1.4.0","ursa":"^0.9.1"},"gitHead":"bf16dba63244aaacf53f65f2e77482602fdee6bf","bugs":{"url":"https://github.com/p7s1-ctf/7pass-nodejs-sdk/issues"},"homepage":"https://github.com/p7s1-ctf/7pass-nodejs-sdk#readme","_id":"7pass-node-sdk@1.0.0","_shasum":"804139da954ec053993aa0a6af00e61d3db51c21","_from":".","_npmVersion":"2.11.3","_nodeVersion":"0.12.7","_npmUser":{"name":"p7s1-ctf","email":"filip.skokan@prosiebensat1.com"},"dist":{"shasum":"804139da954ec053993aa0a6af00e61d3db51c21","tarball":"https://registry.npmjs.org/7pass-node-sdk/-/7pass-node-sdk-1.0.0.tgz","integrity":"sha512-wiL961uT+bl3Oabs+qUHHOHWqBJ5Vo0Mk/7qBSFnbk1LHIPJBtXZcDJ1qVQGxCQ67uXpaM/d3FOjpDrs7ufUUQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIH0xCVQ+/FADn6jHL0hC3ZPYKHhafRB1VcOFLPXa4/2uAiEAquYcj33DniVEMvA7ky0TwIuu2cAzqQiuGx/KREkueXQ="}]},"maintainers":[{"name":"p7s1-ctf","email":"filip.skokan@prosiebensat1.com"}],"directories":{},"deprecated":"Package no longer supported. Use one of the certified Relying Party Libraries instead: https://openid.net/developers/certified/#RPLibs"},"1.0.1":{"name":"7pass-node-sdk","version":"1.0.1","description":"7Pass SDK for Node.js","main":"src/index.js","scripts":{"test":"NODE_ENV=test node_modules/.bin/_mocha","test-ci":"NODE_ENV=test node_modules/.bin/_mocha -R mocha-teamcity-reporter","coverage-ci":"NODE_ENV=test node_modules/.bin/istanbul cover --report teamcity node_modules/.bin/_mocha"},"author":{"name":"7Pass Development Team"},"license":"MIT","repository":{"type":"git","url":"git+ssh://git@github.com/p7s1-ctf/7pass-nodejs-sdk.git"},"devDependencies":{"chai":"^3.2.0","grunt":"^0.4.5","grunt-available-tasks":"^0.6.0","grunt-contrib-jshint":"^0.11.3","grunt-jscs":"^2.1.0","istanbul":"^0.3.22","lodash":"^3.10.1","mocha":"^2.3.2","mocha-teamcity-reporter":"^1.0.0","nock":"^2.13.0","sinon":"^1.17.1"},"dependencies":{"async":"^1.4.2","base64url":"^1.0.4","crypto":"0.0.3","joi":"^6.9.0","jsonwebtoken":"^5.4.0","superagent":"^1.4.0","ursa":"^0.9.1"},"gitHead":"fdab379f581e8b2a394816dd32adaacd7a81040d","bugs":{"url":"https://github.com/p7s1-ctf/7pass-nodejs-sdk/issues"},"homepage":"https://github.com/p7s1-ctf/7pass-nodejs-sdk#readme","_id":"7pass-node-sdk@1.0.1","_shasum":"d23d160937fb5f4f91e5cbe549a2181cb6702951","_from":".","_npmVersion":"2.11.3","_nodeVersion":"0.12.7","_npmUser":{"name":"p7s1-ctf","email":"filip.skokan@prosiebensat1.com"},"dist":{"shasum":"d23d160937fb5f4f91e5cbe549a2181cb6702951","tarball":"https://registry.npmjs.org/7pass-node-sdk/-/7pass-node-sdk-1.0.1.tgz","integrity":"sha512-vqasJ3EedO50pvxQDvvKsmqtlnfFxvMTDllG1Lz1zCStqhdiIxa9RVaBokMLcovRxo94c2HDjN+oxj7ZJXOATQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD+w6bzijtk8Ouyj9+il5rTU4Szza0cPhYRJ5/vaHk25wIhAKPx4zDdlqg7BkY/FHtQA8X2TPbyxwHyh50IP+k9BGu0"}]},"maintainers":[{"name":"p7s1-ctf","email":"filip.skokan@prosiebensat1.com"}],"directories":{},"deprecated":"Package no longer supported. Use one of the certified Relying Party Libraries instead: https://openid.net/developers/certified/#RPLibs"},"1.0.2":{"name":"7pass-node-sdk","version":"1.0.2","description":"7Pass SDK for Node.js","main":"src/index.js","scripts":{"test":"NODE_ENV=test node_modules/.bin/_mocha","test-ci":"NODE_ENV=test node_modules/.bin/_mocha -R mocha-teamcity-reporter","coverage-ci":"NODE_ENV=test node_modules/.bin/istanbul cover --report teamcity node_modules/.bin/_mocha"},"author":{"name":"7Pass Development Team"},"license":"MIT","repository":{"type":"git","url":"git+ssh://git@github.com/p7s1-ctf/7pass-nodejs-sdk.git"},"devDependencies":{"chai":"^3.2.0","grunt":"^0.4.5","grunt-available-tasks":"^0.6.0","grunt-contrib-jshint":"^0.11.3","grunt-jscs":"^2.1.0","istanbul":"^0.3.22","lodash":"^3.10.1","mocha":"^2.3.2","mocha-teamcity-reporter":"^1.0.0","nock":"^2.13.0","sinon":"^1.17.1"},"dependencies":{"async":"^1.4.2","base64url":"^1.0.4","crypto":"0.0.3","joi":"^6.9.0","jsonwebtoken":"^5.4.0","superagent":"^1.4.0","ursa":"^0.9.1"},"gitHead":"366cf74f27f605db3dda778932c21dce49783a34","bugs":{"url":"https://github.com/p7s1-ctf/7pass-nodejs-sdk/issues"},"homepage":"https://github.com/p7s1-ctf/7pass-nodejs-sdk#readme","_id":"7pass-node-sdk@1.0.2","_shasum":"fa1bfbaea83bf9af23cdbc402a56d67fa8ea2dc6","_from":".","_npmVersion":"2.11.3","_nodeVersion":"0.12.7","_npmUser":{"name":"p7s1-ctf","email":"filip.skokan@prosiebensat1.com"},"dist":{"shasum":"fa1bfbaea83bf9af23cdbc402a56d67fa8ea2dc6","tarball":"https://registry.npmjs.org/7pass-node-sdk/-/7pass-node-sdk-1.0.2.tgz","integrity":"sha512-5pCcwNPR6LHeOg5Ejlqrin4KkEHjlCtcmOoOLqZ0nIY2Kb1XnahkY3BLVVBIoJQDkWrJK0M/XvPbiH3RYr4G3Q==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC8cWywhhybXWrQxAPjbx+v1PUX0x8MXbdmg97OxiApSAIgQE9lKCg09Yps02UEzdhzxN7pvd8itDGL0InDl3IbP4k="}]},"maintainers":[{"name":"p7s1-ctf","email":"filip.skokan@prosiebensat1.com"}],"directories":{},"deprecated":"Package no longer supported. Use one of the certified Relying Party Libraries instead: https://openid.net/developers/certified/#RPLibs"},"1.1.0":{"name":"7pass-node-sdk","version":"1.1.0","description":"7Pass SDK for Node.js","main":"src/index.js","scripts":{"test":"NODE_ENV=test node_modules/.bin/_mocha","test-ci":"NODE_ENV=test node_modules/.bin/_mocha -R mocha-teamcity-reporter","coverage-ci":"NODE_ENV=test node_modules/.bin/istanbul cover --report teamcity node_modules/.bin/_mocha"},"author":{"name":"7Pass Development Team"},"license":"MIT","repository":{"type":"git","url":"git+ssh://git@github.com/p7s1-ctf/7pass-nodejs-sdk.git"},"devDependencies":{"chai":"^3.2.0","grunt":"^0.4.5","grunt-available-tasks":"^0.6.0","grunt-contrib-jshint":"^0.11.3","grunt-jscs":"^2.1.0","istanbul":"^0.3.22","lodash":"^3.10.1","mocha":"^2.3.2","mocha-teamcity-reporter":"^1.0.0","nock":"^2.13.0","sinon":"^1.17.1"},"dependencies":{"async":"^1.4.2","base64url":"^1.0.4","crypto":"0.0.3","joi":"^6.9.0","jsonwebtoken":"^5.4.0","superagent":"^1.4.0","ursa":"^0.9.1"},"gitHead":"08829f282c892357701dafa1407cb7fd833a6b2c","bugs":{"url":"https://github.com/p7s1-ctf/7pass-nodejs-sdk/issues"},"homepage":"https://github.com/p7s1-ctf/7pass-nodejs-sdk#readme","_id":"7pass-node-sdk@1.1.0","_shasum":"5465673cb75484db535eb119e325058d2e12ed77","_from":".","_npmVersion":"2.14.7","_nodeVersion":"4.2.3","_npmUser":{"name":"p7s1-ctf","email":"filip.skokan@prosiebensat1.com"},"dist":{"shasum":"5465673cb75484db535eb119e325058d2e12ed77","tarball":"https://registry.npmjs.org/7pass-node-sdk/-/7pass-node-sdk-1.1.0.tgz","integrity":"sha512-zG5AnuQQgNLubLENjsGA0LrG1R5cDGBgYNP03SoVyRb0GrlWvHFgRQCyfgMTEXHgG/2gT16LTLovlcxxGgxf0w==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDV55BOgl4dgd7qbmS3HAcSEgwja8NcQm8fLf/KAk8GkAIhAP/TKeCFNdteh7tFw2I+fVijkQ9c0Rt/eQJN/6fWxEZ2"}]},"maintainers":[{"name":"p7s1-ctf","email":"filip.skokan@prosiebensat1.com"}],"_npmOperationalInternal":{"host":"packages-9-west.internal.npmjs.com","tmp":"tmp/7pass-node-sdk-1.1.0.tgz_1454425030205_0.8934192017186433"},"directories":{},"deprecated":"Package no longer supported. Use one of the certified Relying Party Libraries instead: https://openid.net/developers/certified/#RPLibs"},"1.2.0":{"name":"7pass-node-sdk","version":"1.2.0","description":"7Pass SDK for Node.js","main":"src/index.js","scripts":{"test":"NODE_ENV=test node_modules/.bin/_mocha","test-ci":"NODE_ENV=test node_modules/.bin/_mocha -R mocha-teamcity-reporter","coverage-ci":"NODE_ENV=test node_modules/.bin/istanbul cover --report teamcity node_modules/.bin/_mocha"},"author":{"name":"7Pass Development Team"},"license":"MIT","repository":{"type":"git","url":"git+ssh://git@github.com/p7s1-ctf/7pass-nodejs-sdk.git"},"devDependencies":{"chai":"^3.2.0","grunt":"^0.4.5","grunt-available-tasks":"^0.6.0","grunt-contrib-jshint":"^0.11.3","grunt-jscs":"^2.1.0","istanbul":"^0.3.22","lodash":"^3.10.1","mocha":"^2.3.2","mocha-teamcity-reporter":"^1.0.0","nock":"^2.13.0","sinon":"^1.17.1"},"dependencies":{"async":"^1.4.2","base64url":"^1.0.4","crypto":"0.0.3","joi":"^6.9.0","jsonwebtoken":"^5.4.0","superagent":"^1.4.0","ursa":"^0.9.1"},"gitHead":"9095303dec5c67a0030c0acc4327d69473f608bf","bugs":{"url":"https://github.com/p7s1-ctf/7pass-nodejs-sdk/issues"},"homepage":"https://github.com/p7s1-ctf/7pass-nodejs-sdk#readme","_id":"7pass-node-sdk@1.2.0","_shasum":"84c9152229f3ae10108d60451eb9fa599c4bf61a","_from":".","_npmVersion":"2.14.20","_nodeVersion":"4.4.0","_npmUser":{"name":"p7s1-ctf","email":"filip.skokan@prosiebensat1.com"},"dist":{"shasum":"84c9152229f3ae10108d60451eb9fa599c4bf61a","tarball":"https://registry.npmjs.org/7pass-node-sdk/-/7pass-node-sdk-1.2.0.tgz","integrity":"sha512-p6KavWJE0sEbVJ4QpZHBkA5ehbPLGdNDMFVmoWWWqNWXo+NLPKYBJqlRNmyaRlkDNaeSOyWu3+ePe+xlm4n96g==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCF2t78atQxoFJRvrC9705HTOZxvfNS/keIuYnJ1RwLTwIhAPZ//llH0KdpxsgpmgPpUsOb3Ti4/RUq6T4QSag89+Hh"}]},"maintainers":[{"name":"p7s1-ctf","email":"filip.skokan@prosiebensat1.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/7pass-node-sdk-1.2.0.tgz_1458296043035_0.7742953163105994"},"directories":{},"deprecated":"Package no longer supported. Use one of the certified Relying Party Libraries instead: https://openid.net/developers/certified/#RPLibs"},"1.2.1":{"name":"7pass-node-sdk","version":"1.2.1","description":"7Pass SDK for Node.js","main":"src/index.js","scripts":{"test":"NODE_ENV=test node_modules/.bin/_mocha","pretest":"NODE_ENV=test grunt lint","test-ci":"NODE_ENV=test node_modules/.bin/_mocha -R mocha-teamcity-reporter","pretest-ci":"NODE_ENV=test grunt teamcity-lint","coverage-ci":"NODE_ENV=test node_modules/.bin/istanbul cover --report teamcity node_modules/.bin/_mocha"},"author":{"name":"7Pass Development Team"},"license":"MIT","repository":{"type":"git","url":"git+ssh://git@github.com/p7s1-ctf/7pass-nodejs-sdk.git"},"devDependencies":{"chai":"^3.2.0","grunt":"^0.4.5","grunt-available-tasks":"^0.6.0","grunt-contrib-jshint":"^0.11.3","grunt-jscs":"^2.1.0","istanbul":"^0.3.22","lodash":"^3.10.1","mocha":"^2.3.2","mocha-teamcity-reporter":"^1.0.0","nock":"^2.13.0","sinon":"^1.17.1"},"dependencies":{"async":"^1.4.2","base64url":"^1.0.4","crypto":"0.0.3","joi":"^6.9.0","jsonwebtoken":"^5.4.0","superagent":"^1.4.0","ursa":"^0.9.1"},"gitHead":"2910abd5eca6bc6e88066fdf5fce836b64d916a9","bugs":{"url":"https://github.com/p7s1-ctf/7pass-nodejs-sdk/issues"},"homepage":"https://github.com/p7s1-ctf/7pass-nodejs-sdk#readme","_id":"7pass-node-sdk@1.2.1","_shasum":"23184f5e38d67110cdc1f3af33305afcc501459d","_from":".","_npmVersion":"2.14.12","_nodeVersion":"4.3.1","_npmUser":{"name":"p7s1-ctf","email":"filip.skokan@prosiebensat1.com"},"dist":{"shasum":"23184f5e38d67110cdc1f3af33305afcc501459d","tarball":"https://registry.npmjs.org/7pass-node-sdk/-/7pass-node-sdk-1.2.1.tgz","integrity":"sha512-fXQi6gcYV1HQQRPplUx49maYMgrsPuRnWaIucq3yXzrMTcnSZa71yabN1cFt/9IlWVV2e+Wo8sSBc+XzeoxDTg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGAdkh2V5S8aJA/VA3Yng6ILHooFwpSfs3Jeqt6YNRSVAiAg0tUL1rWX7nJlWsnOMaWLNP/788oC2e5lbuO2PwYo9A=="}]},"maintainers":[{"name":"p7s1-ctf","email":"filip.skokan@prosiebensat1.com"}],"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/7pass-node-sdk-1.2.1.tgz_1460723690526_0.8866839169058949"},"directories":{},"deprecated":"Package no longer supported. Use one of the certified Relying Party Libraries instead: https://openid.net/developers/certified/#RPLibs"},"1.3.0":{"name":"7pass-node-sdk","version":"1.3.0","description":"7Pass SDK for Node.js","main":"src/index.js","scripts":{"test":"NODE_ENV=test node_modules/.bin/_mocha","pretest":"NODE_ENV=test grunt lint","test-ci":"NODE_ENV=test node_modules/.bin/_mocha -R mocha-teamcity-reporter","pretest-ci":"NODE_ENV=test grunt teamcity-lint","coverage-ci":"NODE_ENV=test node_modules/.bin/istanbul cover --report teamcity node_modules/.bin/_mocha"},"author":{"name":"7Pass Development Team"},"license":"MIT","repository":{"type":"git","url":"git+ssh://git@github.com/p7s1-ctf/7pass-nodejs-sdk.git"},"devDependencies":{"chai":"^3.2.0","grunt":"^1.0.1","grunt-available-tasks":"^0.6.0","grunt-contrib-jshint":"^1.0.0","grunt-jscs":"^2.1.0","istanbul":"^0.4.3","lodash":"^3.10.1","mocha":"^2.3.2","mocha-teamcity-reporter":"^1.0.0","nock":"^2.13.0","sinon":"^1.17.1"},"dependencies":{"async":"^1.4.2","base64url":"^1.0.6","crypto":"0.0.3","joi":"^6.9.0","jsonwebtoken":"^5.4.0","superagent":"^1.8.3","ursa":"^0.9.4"},"bugs":{"url":"https://github.com/p7s1-ctf/7pass-nodejs-sdk/issues"},"homepage":"https://github.com/p7s1-ctf/7pass-nodejs-sdk#readme","_id":"7pass-node-sdk@1.3.0","_shasum":"b07204f0f51ae367f652ea985503e687093cd93b","_from":".","_npmVersion":"2.15.1","_nodeVersion":"4.4.4","_npmUser":{"name":"p7s1-ctf","email":"filip.skokan@prosiebensat1.com"},"dist":{"shasum":"b07204f0f51ae367f652ea985503e687093cd93b","tarball":"https://registry.npmjs.org/7pass-node-sdk/-/7pass-node-sdk-1.3.0.tgz","integrity":"sha512-4qwNapFnIyZuWI4u5Y/EmgVk05UIdN96Dq94a/nGU75T5yN6zeD/2IPy0wnbPbFoyZ35tTJMMbKkR7rrxHpi1A==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEeoeAEIA7TW1kMM0G22jDCaKv7W+d+QJcMXahdtHZ0nAiEA/LOpIYJmd1YbKuaDJFq4HrxY4ncLp2Yr6DTDyym+J7o="}]},"maintainers":[{"name":"p7s1-ctf","email":"filip.skokan@prosiebensat1.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/7pass-node-sdk-1.3.0.tgz_1463149556948_0.08015445386990905"},"directories":{},"deprecated":"Package no longer supported. Use one of the certified Relying Party Libraries instead: https://openid.net/developers/certified/#RPLibs"},"1.3.1":{"name":"7pass-node-sdk","version":"1.3.1","description":"7Pass SDK for Node.js","main":"src/index.js","scripts":{"test":"NODE_ENV=test node_modules/.bin/_mocha","pretest":"NODE_ENV=test grunt lint","test-ci":"NODE_ENV=test node_modules/.bin/_mocha -R mocha-teamcity-reporter","pretest-ci":"NODE_ENV=test grunt teamcity-lint","coverage-ci":"NODE_ENV=test node_modules/.bin/istanbul cover --report teamcity node_modules/.bin/_mocha"},"author":{"name":"7Pass Development Team"},"license":"MIT","repository":{"type":"git","url":"git+ssh://git@github.com/p7s1-ctf/7pass-nodejs-sdk.git"},"devDependencies":{"chai":"^3.2.0","eslint":"^2.1.0","grunt":"^1.0.1","grunt-available-tasks":"^0.6.0","gruntify-eslint":"^2.0.0","istanbul":"^0.4.3","lodash":"^3.10.1","mocha":"^2.3.2","mocha-teamcity-reporter":"^1.0.0","nock":"^2.13.0","sinon":"^1.17.1"},"dependencies":{"async":"^1.4.2","base64url":"^1.0.6","crypto":"0.0.3","joi":"^6.9.0","jsonwebtoken":"^5.4.0","superagent":"^1.8.3","ursa":"^0.9.4"},"gitHead":"a464ac2a017caf7d4883c9308123a97776fad0a5","bugs":{"url":"https://github.com/p7s1-ctf/7pass-nodejs-sdk/issues"},"homepage":"https://github.com/p7s1-ctf/7pass-nodejs-sdk#readme","_id":"7pass-node-sdk@1.3.1","_shasum":"7c73d35b4e7063435f13e0c2bf3c609b76556df7","_from":".","_npmVersion":"3.10.3","_nodeVersion":"6.3.1","_npmUser":{"name":"p7s1-ctf","email":"filip.skokan@prosiebensat1.com"},"dist":{"shasum":"7c73d35b4e7063435f13e0c2bf3c609b76556df7","tarball":"https://registry.npmjs.org/7pass-node-sdk/-/7pass-node-sdk-1.3.1.tgz","integrity":"sha512-d20+hPSDFFaWUkcJW8PWqIKeDCxXvW3jMekKyIWtNI0syXrIs+bc/5drRwlOPDT7auQKEYJOUOTemQBot88Hmg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICWf17Bp5t2Bo0Azp3YZzlLfdx7wcdVRoNGDAO8W+GV1AiEAp++wMxsP/Pf4NEdCR7uaLeL+K0d+yUnjJ6TPPnsxRW8="}]},"maintainers":[{"name":"p7s1-ctf","email":"filip.skokan@prosiebensat1.com"}],"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/7pass-node-sdk-1.3.1.tgz_1478176305610_0.9112068046815693"},"directories":{},"deprecated":"Package no longer supported. Use one of the certified Relying Party Libraries instead: https://openid.net/developers/certified/#RPLibs"},"1.3.2":{"name":"7pass-node-sdk","version":"1.3.2","description":"7Pass SDK for Node.js","main":"src/index.js","scripts":{"test":"NODE_ENV=test node_modules/.bin/_mocha","pretest":"NODE_ENV=test grunt lint","test-ci":"NODE_ENV=test node_modules/.bin/_mocha -R mocha-teamcity-reporter","pretest-ci":"NODE_ENV=test grunt teamcity-lint","coverage-ci":"NODE_ENV=test node_modules/.bin/istanbul cover --report teamcity node_modules/.bin/_mocha"},"author":{"name":"7Pass Development Team"},"license":"MIT","repository":{"type":"git","url":"git+ssh://git@github.com/p7s1-ctf/7pass-nodejs-sdk.git"},"devDependencies":{"chai":"^3.2.0","eslint":"^2.1.0","grunt":"^1.0.1","grunt-available-tasks":"^0.6.0","gruntify-eslint":"^2.0.0","istanbul":"^0.4.3","lodash":"^3.10.1","mocha":"^2.3.2","mocha-teamcity-reporter":"^1.0.0","nock":"^2.13.0","sinon":"^1.17.1"},"dependencies":{"async":"^1.4.2","base64url":"^1.0.6","crypto":"0.0.3","joi":"^6.9.0","jsonwebtoken":"^5.4.0","superagent":"^1.8.3","ursa":"^0.9.4"},"gitHead":"262dead31c69ed6756063e1a278662bd55b256c7","bugs":{"url":"https://github.com/p7s1-ctf/7pass-nodejs-sdk/issues"},"homepage":"https://github.com/p7s1-ctf/7pass-nodejs-sdk#readme","_id":"7pass-node-sdk@1.3.2","_shasum":"ce6eb2bda4b6435011a51709ba515fea958e3793","_from":".","_npmVersion":"3.10.3","_nodeVersion":"6.3.1","_npmUser":{"name":"p7s1-ctf","email":"filip.skokan@prosiebensat1.com"},"dist":{"shasum":"ce6eb2bda4b6435011a51709ba515fea958e3793","tarball":"https://registry.npmjs.org/7pass-node-sdk/-/7pass-node-sdk-1.3.2.tgz","integrity":"sha512-h0clc45GNesns3ahv6HHLjUcunqMkPMImvvkVkgJ5Ig8hMUbnQ+DzXOHaLcoNan+Zhve+wK1UXGU972KIOOo8w==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDV+t6NwYGgzyFzarNquZ892Y14WJTY4Jk4mtfZ0vPLigIgC7RcNGG87DA90zZ7qAU7N+7rZ/MUCykokt0+/YYsQRk="}]},"maintainers":[{"name":"p7s1-ctf","email":"filip.skokan@prosiebensat1.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/7pass-node-sdk-1.3.2.tgz_1478176858711_0.4656344214454293"},"directories":{},"deprecated":"Package no longer supported. Use one of the certified Relying Party Libraries instead: https://openid.net/developers/certified/#RPLibs"},"1.3.3":{"name":"7pass-node-sdk","version":"1.3.3","description":"7Pass SDK for Node.js","main":"src/index.js","scripts":{"test":"NODE_ENV=test node_modules/.bin/_mocha","pretest":"NODE_ENV=test grunt lint","test-ci":"NODE_ENV=test node_modules/.bin/_mocha -R mocha-teamcity-reporter","pretest-ci":"NODE_ENV=test grunt teamcity-lint","coverage-ci":"NODE_ENV=test node_modules/.bin/istanbul cover --report teamcity node_modules/.bin/_mocha"},"author":{"name":"7Pass Development Team"},"license":"MIT","repository":{"type":"git","url":"git+ssh://git@github.com/p7s1-ctf/7pass-nodejs-sdk.git"},"devDependencies":{"chai":"^3.2.0","eslint":"^2.1.0","grunt":"^1.0.1","grunt-available-tasks":"^0.6.0","gruntify-eslint":"^2.0.0","istanbul":"^0.4.3","lodash":"^3.10.1","mocha":"^2.3.2","mocha-teamcity-reporter":"^1.0.0","nock":"^2.13.0","sinon":"^1.17.1"},"dependencies":{"async":"^1.4.2","base64url":"^1.0.6","crypto":"0.0.3","joi":"^6.9.0","jsonwebtoken":"^5.4.0","superagent":"^1.8.3","ursa":"^0.9.4"},"gitHead":"d376634a0e08742658ab1c628dc553d65953daa6","bugs":{"url":"https://github.com/p7s1-ctf/7pass-nodejs-sdk/issues"},"homepage":"https://github.com/p7s1-ctf/7pass-nodejs-sdk#readme","_id":"7pass-node-sdk@1.3.3","_shasum":"141906cf2dcdb1df7f62ddaf2f15eac3174017db","_from":".","_npmVersion":"2.15.9","_nodeVersion":"4.6.0","_npmUser":{"name":"p7s1-ctf","email":"filip.skokan@prosiebensat1.com"},"dist":{"shasum":"141906cf2dcdb1df7f62ddaf2f15eac3174017db","tarball":"https://registry.npmjs.org/7pass-node-sdk/-/7pass-node-sdk-1.3.3.tgz","integrity":"sha512-3uAOs+dD0NXT/edEtVKWPqzsdlSz27CvP1P37HN6m4BeynCeguEqIlc8kBlSNoM9Xhgz/N1aMJOZWDp5y1a8xQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDjpierLkgP55v4zBH3Ki6LC5XTmdM9923nKXBzJL8RKgIhAPRUnh7sE9PmSQCj9BGFKMVPgSCD4fDXhkMp53GvaYYf"}]},"maintainers":[{"name":"p7s1-ctf","email":"filip.skokan@prosiebensat1.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/7pass-node-sdk-1.3.3.tgz_1479125594037_0.8679706938564777"},"directories":{},"deprecated":"Package no longer supported. Use one of the certified Relying Party Libraries instead: https://openid.net/developers/certified/#RPLibs"},"2.0.0":{"name":"7pass-node-sdk","version":"2.0.0","description":"7Pass SDK for Node.js","main":"src/index.js","scripts":{"test":"NODE_ENV=test node_modules/.bin/_mocha","pretest":"NODE_ENV=test grunt lint","test-ci":"NODE_ENV=test node_modules/.bin/_mocha -R mocha-teamcity-reporter","pretest-ci":"NODE_ENV=test grunt teamcity-lint","coverage-ci":"NODE_ENV=test node_modules/.bin/istanbul cover --report teamcity node_modules/.bin/_mocha"},"author":{"name":"7Pass Development Team"},"license":"MIT","repository":{"type":"git","url":"git+ssh://git@github.com/p7s1-ctf/7pass-nodejs-sdk.git"},"devDependencies":{"chai":"^3.2.0","eslint":"^2.1.0","grunt":"^1.0.1","grunt-available-tasks":"^0.6.0","gruntify-eslint":"^2.0.0","istanbul":"^0.4.3","lodash":"^3.10.1","mocha":"^2.3.2","mocha-teamcity-reporter":"^1.0.0","nock":"^2.13.0","sinon":"^1.17.1"},"dependencies":{"async":"^1.4.2","base64url":"^1.0.6","crypto":"0.0.3","joi":"^6.9.0","jsonwebtoken":"^5.4.0","superagent":"^1.8.3","ursa":"^0.9.4"},"files":["src"],"gitHead":"1e6cac840cdec5ca719a91053426f9e9a7669ddb","bugs":{"url":"https://github.com/p7s1-ctf/7pass-nodejs-sdk/issues"},"homepage":"https://github.com/p7s1-ctf/7pass-nodejs-sdk#readme","_id":"7pass-node-sdk@2.0.0","_shasum":"3772c8ecdba9fb95e428f62fcadaa0ae9db091ca","_from":".","_npmVersion":"3.10.10","_nodeVersion":"6.11.4","_npmUser":{"name":"p7s1-ctf","email":"filip.skokan@prosiebensat1.com"},"dist":{"shasum":"3772c8ecdba9fb95e428f62fcadaa0ae9db091ca","tarball":"https://registry.npmjs.org/7pass-node-sdk/-/7pass-node-sdk-2.0.0.tgz","integrity":"sha512-YjJCPdYTpH//OfL291zv2JfU3Wa9F3dLU+WvPUQygQ7GtDDOxThUc1nsc3+/fVXE5Pv9hvPTB33c2Xc3JdLvAQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGkKBPadWCXgZwXivadflG/qG5oExO5sINl7EooaAsZeAiEAnpK1PLV3s4OWny1cc5VJPbQ3gdi1983xVQA1RSRjNN4="}]},"maintainers":[{"name":"p7s1-ctf","email":"filip.skokan@prosiebensat1.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/7pass-node-sdk-2.0.0.tgz_1508846412064_0.07402295526117086"},"directories":{},"deprecated":"Package no longer supported. Use one of the certified Relying Party Libraries instead: https://openid.net/developers/certified/#RPLibs"},"2.0.1":{"name":"7pass-node-sdk","version":"2.0.1","description":"7Pass SDK for Node.js","main":"src/index.js","scripts":{"test":"NODE_ENV=test node_modules/.bin/_mocha","pretest":"NODE_ENV=test grunt lint","test-ci":"NODE_ENV=test node_modules/.bin/_mocha -R mocha-teamcity-reporter","pretest-ci":"NODE_ENV=test grunt teamcity-lint","coverage-ci":"NODE_ENV=test node_modules/.bin/istanbul cover --report teamcity node_modules/.bin/_mocha"},"author":{"name":"7Pass Development Team"},"license":"MIT","repository":{"type":"git","url":"git+ssh://git@github.com/p7s1-ctf/7pass-nodejs-sdk.git"},"devDependencies":{"chai":"^3.2.0","eslint":"^2.1.0","grunt":"^1.0.1","grunt-available-tasks":"^0.6.0","gruntify-eslint":"^2.0.0","istanbul":"^0.4.3","lodash":"^4.17.10","mocha":"^2.3.2","mocha-teamcity-reporter":"^1.0.0","nock":"^2.13.0","sinon":"^1.17.1"},"dependencies":{"async":"^1.4.2","base64url":"^1.0.6","crypto":"0.0.3","joi":"^6.9.0","jsonwebtoken":"^5.4.0","superagent":"^3.8.3","ursa":"^0.9.4"},"files":["src"],"gitHead":"98bdaa92de024ea732de30060bb1902ec4a1d343","bugs":{"url":"https://github.com/p7s1-ctf/7pass-nodejs-sdk/issues"},"homepage":"https://github.com/p7s1-ctf/7pass-nodejs-sdk#readme","_id":"7pass-node-sdk@2.0.1","_npmVersion":"5.6.0","_nodeVersion":"8.11.3","_npmUser":{"name":"p7s1-ctf","email":"philipp.ebner@prosiebensat1.com"},"dist":{"integrity":"sha512-J2kNeOgd3WSRpzXuLR2JCw/oQoOhAldMPejxzgubTBowUPgQfvPHVPSZGAJIWJhCEszcFyPo1X2YeHe2MpSdEw==","shasum":"05937b7304efb3b02b00dcf19a5d83ee6115dfca","tarball":"https://registry.npmjs.org/7pass-node-sdk/-/7pass-node-sdk-2.0.1.tgz","fileCount":13,"unpackedSize":45807,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbe8LKCRA9TVsSAnZWagAAzOgP/jpCWLyspzSZsL2Gs5/0\nD/y9bjCReKGOk56jhIRx+b3uZKNewq/wUKuiB9ODFWaFp+1mGJMsW5tgRuIH\nTcZTbRRJepbhjRmcQnd1jNpFzD+yYuNcQHIoa4slR7dS5WUDY982SE0LS33W\njW0su4qUDkt8reo/WM3UO32hOMEvuZWRD1IfUCsTZxoyN+D2wRFnnkTmD5Wu\nZ1/lsDeCiNKAYYnUhcGE1ZeFiLSUKOzsJvRgP9o3RIto+IKqhUaVM7DTm16V\nZ/loKn3rcDqhIXFqUd9QwZAWBecK4jMD9fSxS51GySVd/JPP66yupNGmZozs\nF70wd8IlNtQyC3O6vGXH+ySj1Udey4Ui7+8MHzclKQY5URTdbA/htvmbeig1\nKXEwYt8CX6E48b3V+O30KQNED60SK0XC+M5A4QN7t3SHbBRD0I4ynxIjAJ/k\nuvx1bDzDzKi5fcwhiFwSIOGYOKWnIXd7RgcvBaxDY9a19v39YQ9jan+Q+kDS\nt2HZoKQPOJHFZvzONhQbnl2O/LRgO6YsF6jfcWNLLcZ5NFMBq2cr/ViufmZ/\nUPN9BKIZ6TFxZ/gtnVt4DH/vXgUVM1/awO/Yn0G96OP4ewJc/K6GY4kqlJvn\nwi9eMcT043b0TT89gNhYEBNZrzOxuMCGT+tdIbT336Tkg+tHOcF2SqaY9JWI\nwHFn\r\n=HjQx\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD5NDYBF0JIHlkpIEBLxIkPKBFSsVoMjL7L5bMUTW17sgIhANHBDspOFdHCq6SiDk2KGgIEV8hYin4clzqKqfFR1Rkv"}]},"maintainers":[{"email":"philipp.ebner@prosiebensat1.com","name":"p7s1-ctf"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/7pass-node-sdk_2.0.1_1534837450047_0.4173900054411934"},"_hasShrinkwrap":false,"deprecated":"Package no longer supported. Use one of the certified Relying Party Libraries instead: https://openid.net/developers/certified/#RPLibs"}},"readme":"# 7Pass NodeJS SDK\n\n7Pass NodeJS SDK is a JS library for interacting with the\n[7Pass SSO service](https://7pass.de). You can use this library to\nimplement authentication for your website and take advantage of the\nalready existing features that 7Pass SSO offers.\n\n## Installation\n\nTo install the package, run the following:\n\n```\nnpm install 7pass-node-sdk\n```\n\n## Running the example application\n\nTo demonstrate the functionality of the library, there's an\ninteractive tutorial / guide available. Before we get started setting\nit up, you need your web application's client. The client represents\nthe entity which is associated with a service you want to authenticate\nto.\n\nTo obtain the client credentials, you first need to contact the 7Pass\nTech Team.\n\nOnce you have the credentials available, you can go ahead and run the application.\n\nFirst SDK library dependencies need to be installed:\n\n```\nnpm install\n```\n\nThen you go to the `example_app` directory and install example application dependencies:\n\n```\ncd example_app\nnpm install\n```\n\nCreate the local configuration file:\n\n```\ncp config.local.js.example config.local.js\n```\n\nEdit the `config.local.js` file in your favorite editor and fill out\nthe details. You should have all of the parameters at your disposal\nafter your client is set up. For testing, keep the environment set to\n`qa`. Once that's done, you can start the application:\n\n```\nnpm start\n```\n\nThe example application should be now available at\n`http://localhost:8000`. The application will guide you through the\nmost common use cases of the library and show you code examples and\nserver responses along the way.\n\n\n## API Usage\n\nYou strongly encouraged to go over the example application first. It\nwill show you the API calls with more comments and real values. It\nwill also show you the real responses from the 7Pass SSO service as\nyou progress.\n\nTo use the library, it's necessary to initialize it with the\ncredentials of the client we want to use. If you don't have the\ncredentials yet, please see above.\n\n- client_id (required)\n- client_secret (required)\n\nIf you're starting the development, it's always a good idea to work\nagainst a non live instance of the 7Pass SSO service. To specify the\ninstance (the environment) against which you want to issue the\nrequests, you can pass an additional key called environment to the\nconfiguration. There are currently two environments running: QA and\nproduction. Don't forget to switch to the production version before\nyou release your application to the public.\n\n\n\n```js\nvar sevenpass = require('7pass-node-sdk');\n\nvar config = {\n  client_id: 'YOUR_CLIENT_ID',\n  client_secret: 'YOUR_CLIENT_SECRET',\n  environment: 'qa' // Optional, defaults to 'production'\n};\n\n// 1. Create and initialize the configuration object\n// Configuration object fetches OpenID Configuration and JWT public key endpoints\nsevenpass.Configuration.createAndInit(config, function(err, ssoConfig) {\n  if(err) {\n    throw err;\n  }\n\n  // 2. Create 7Pass SSO object passing initialized Configuration object\n  var sso = new sevenpass.SSO(ssoConfig);\n\n  //your app code continues here.\n});\n```\n\nFor both environments there is a default `host` URL where 7Pass API endpoints can be reached on.\nFor `production` environment it is https://sso.7pass.de and for `qa` a host is https://sso.qa.7pass.ctf.prosiebensat1.com.\nIf needed, this can be overwritten by specifying `host` in the configuration as below:\n\n```\nvar config = {\n    host: 'https://mysubdomain.7pass.de',\n    // ... other config values\n};\n```\n\n## Authentication flow\n\nThe authentication process is simple and the high level view is as\nfollows: The user is redirected to the 7Pass SSO service using a\nspecially crafted URL and he/she signs in (or signs up). Once the user\nhas finished the process, he/she is redirected back to your\napplication with a special code in the URL. The application will then\nuse the code in order to get the user's details. The process may vary\ndepending on the passed options.\n\n### 1. Get a redirect URL\n\nThe library automatically handles the generation of the URL to which\nthe user needs to be redirected. The only required parameter is the\n`redirect_uri` URL. The URL needs to be absolute and can be arbitrary\n(given that it is registered to the client) but will by convention\nlead to the same host and a route called \"callback\".\n\nUse of [state](http://guide.docs.7pass.ctf.prosiebensat1.com/api/index.html#api-OpenID_Connect-OpenIDAuthorize)\nparameter is optional but recommended to avoid CSRF attacks\n- the value is usually stored in the session and is also used with `sso.authorization().callback()`\nmethod when handling the callback request.\n\n```js\noptions = {\n  redirect_uri: 'https://example.com/callback', // Required.\n  scope: 'openid profile email', // Optional, default value.\n  response_type: 'code' // Optional, default value.\n  state: sessionState // Optional, but recommended to avoid CSRF attacks\n};\n\nredirectUrl = sso.authorization().authorizeUri(options);\n```\n\nThe library will automatically set the `client_id` and `nonce` (a\nunique request identifier) parameters automatically.\n\n### 2. Redirect an user\n\nNow it's time to redirect the user to the generated URL.\n\n### 3. Handling 7Pass callback\n\nAfter the user has finished with the sign in/up dialog, he/she has\nbeen redirected to the redirect_uri URL with the outcome of the sign\nin process. The user might have successfully authenticated but also\nmight have decided to cancel the process or some other error might\nhave happened. Therefore it's important have proper error handling.\n\nWhenever an error occurs, there will be two query parameters present\nin the URL - `error` and `error_description`. The error parameter\ncontains an error code and the error_description contains a human\nreadable description of the error suitable for direct displaying to\nthe user.\n\nYou might choose to handle an error manually as below. Otherwise in case of an error,\n`sso.authorization().callback()` callback receives AuthorizeCallbackException error.\n\n```js\n// 1. Check if query params contain callback error\nif(queryParams.error) {\n  var error = queryParams.error;\n  var errorDescription = queryParams.error_description;\n\n  // 2. Handle the error and display appropriate message to your end-user.\n}\n```\n\nThe library handles retrieving the tokens on its own, you just need to provide\nthe redirect_uri and also query parameters from the request.\nThis allows you to retrieve the tokens which can be used to fetch the actual information about the user later.\nThese tokens are specific to the particular user and are private.\nYou need to keep them secured and do not share them with anybody.\n\n`sessionState` parameter is optional but same should be provided\nif used with `sso.authorization().authorizeUri()` method.\nAuthorizeCallbackException callback error is received when state value provided and\nthe one retrieved from query parameters do not match.\n\n```js\n// queryParams variable below contains query parameters from the current URL\n\n// 1. Request access token\nsso.authorization().callback(callbackUri, queryParams, sessionState, function(err, tokens) {\n  if(err) {\n    throw err;\n  }\n\n  // 2. Store tokens into the user's session storage. You might also want\n  //    to store them in your persistent storage (i.e. your database) or\n  //    any other storage of your own choosing.\n});\n```\n\nThe received response will have the following structure. Run the\nexample application to see the real values.\n\n```js\n{\n  \"access_token\": ACCESS_TOKEN,\n  \"token_type\": \"Bearer\",\n  \"refresh_token\": REFRESH_TOKEN,\n  \"expires_in\": 7200,\n  \"id_token\": JWT_STRING,\n  \"received_at\": RECEIVED_AT_TIMESTAMP,\n  \"id_token_decoded\": DECODED_JWT\n}\n```\n\nNote: The `id_token_decoded` value is decoded from the `id_token`\nfield and verified. If token verification fails, the error is thrown.\n\n### 4. Caching an access token\n\nThe tokens are represented in a single object of type\n`TokenSet`. You can now store tokens into the user's session storage.\nYou might also want to store them in your persistent storage (i.e. your database) or\nany other storage of your own choosing.\n\n\nAccess tokens are valid for certain amount of time specified in\nseconds in the `expires_in` field. Once the access token expires, it\ncan no longer be used. You can obtain a new one using the refresh\ntoken as follows:\n\n```js\nvar TokenSet = require('7pass-node-sdk').TokenSet;\n\nfunction getFreshTokens(callback) {\n  // 1. Create TokenSet object - tokensData contains hash of tokens data as retrieved from user's session\n  tokens = new TokenSet(tokensData);\n\n  // 2. Check whether the access token has expired and return immediately if not.\n  if(!tokens.isAccessTokenExpired()) {\n    return callback(null, tokens);\n  }\n\n  // 3. Refresh tokens\n  sso.authorization().refresh(tokens, function(err, refreshedTokens) {\n    if(err) {\n      return callback(err);\n    }\n\n    // 4. Store the refreshed tokens back into user's session storage.\n\n    // 5. Return fresh tokens\n    callback(null, refreshedTokens)\n  });\n}\n\ngetFreshTokens(function(err, tokens) {\n  // Now when you made sure tokens are fresh, you can use them further to create API clients.\n})\n```\n\n_Note: `refresh()` method above also accepts object like `{ refresh_token: 'REFRESH_TOKEN' }` as an argument._\n\n### 5. Calling our API endpoints\n\nNow that we're sure the tokens are up to date, we can start making\nrequests to the 7Pass SSO service to get the user data.\n\nSame as with the previous example, run the example application to see\nthe real server response.\n\n```js\n// Create a client object using the tokens\nvar accountClient = sso.accountClient(tokens);\n\naccountClient.get('me', function(err, data) {\n  // Handle error\n\n  // 'data' variable contains the response data\n});\n\n```\n\nThe 7Pass SSO service offers quite a few of these endpoints. To learn\nmore about them, you can go to\n[the official documentation's overview](http://guide.docs.7pass.ctf.prosiebensat1.com/api/index.html?focusTabs=node#api-Accounts).\n\n## Client Credentials requests\n\nThe library supports multiple types of \"clients\". These clients\ngenerally differ in the required configuration parameters and\nafterwards in the functionality they provide. The \"client credentials\"\nclient is a special kind of client which is not associated with a user\naccount and can be only used to call the \"clients\" APIs.\n\nYou can see all of the available endpoints in the\n[documentation](http://guide.docs.7pass.ctf.prosiebensat1.com/api)\nwith the accessType parameter equal to `client`.\n\n\n```js\nvar sevenpass = require('7pass-node-sdk'), sso;\n\nvar config = {\n  client_id: 'YOUR_CLIENT_ID',\n  client_secret: 'YOUR_CLIENT_SECRET',\n  environment: 'qa' // Optional, defaults to 'production'\n};\n\n// 1. Create and initialize the configuration object\n// Configuration object fetches OpenID Configuration and JWT public key endpoints\nsevenpass.Configuration.createAndInit(config, function(err, ssoConfig) {\n  if(err) {\n    throw err;\n  }\n\n  // 2. Create 7Pass SSO object passing initialized Configuration object\n  sso = new sevenpass.SSO(ssoConfig);\n\n  // 3. Get the tokens using the client credentials grant type\n  sso.authorization().clientCredentials(handleClientCredentialsAuthorization);\n});\n\nfunction handleClientCredentialsAuthorization(err, tokens) {\n  if(err) {\n    throw err;\n  }\n\n  // 4. Use the client as you normally would when using the standard access\n  var clientCredentialsClient = sso.clientCredentialsClient(tokens);\n  clientCredentialsClient.post('checkPassword', {\n    password: 'PASSWORD'\n  }, function(err, data) {\n    //handle response\n  });\n}\n```\n\n## Device flow\n\nWith device flow people can easily and safely log into apps and services\nwith their 7Pass account on devices with limited input or display capabilities.\nThis includes Smart TVs, digital photo frames, or Internet of Things devices.\n\nThe device (your application) instructs the end-user to use another computer or device and connect\nto 7Pass to approve the access request. Since your application cannot receive\nincoming requests, it polls the 7Pass authorization server repeatedly until\nthe end-user completes the approval process.\n\nYour application initiates the flow by requesting a set of verification\ncodes from the authorization server by making an HTTP POST request\nto the token endpoint.\n   \n```\nsso.authorization().deviceCode(function(err, deviceCodeResponse) {\n    // handle error\n    \n    // deviceCodeReponse - see example below\n});\n```\n\n`deviceCodeResponse` would be object like the following:\n\n```\n{\n    code: CODE         // used along with poll requests (see below)\n    user_code: Q9CFLH  // the code which user should enter on LINK page \n    expires_in: 600    // expiration of the code (in seconds) \n    interval: 5        // recommended interval for repeating poll requests (in seconds)\n    link: LINK_URL     // verification URL user should use to authenticate\n    link_qr: IMAGE_URL // image URL of QR code encoded link\n}\n```\n\nThe user should now be prompted to visit `link` URL on another device to\nenter `user_code`. `link_qr` is URL of an image representing QR code encoded `link` URL.\nThis could be used by users using mobile devices, they can scan it and have `link` URL opened\nin their mobile browsers without manually typing it themselves.\n\nWhile user tries to authenticate on `link` URL, your application polls 7Pass server repeatedly.\nRecommended interval is specified in `interval` value.\n\n`code` in the example below can be either `deviceCodeResponse` object received from `sso.authorization().deviceCode()` method call,\nobject with `code` property or simply a string with `code` value.\n\n```\n// repeat every [interval] seconds.\nsso.authorization().deviceCodePoll(code, function(err, response) {\n    if (err) {\n        // handle the error appropriately\n        // if OAuth2 error: err.error is set to one of error codes 'code_expired', 'slow_down', 'invalid_grant'\n        return;\n    }\n    \n    // reponse === false in case 'authorization_pending' response is received\n    \n    if (response !== false) {\n        // reponse is TokenSet object\n        // stop polling - user has authorized from another device successfully\n    }\n});\n```\n\n\n## Backoffice requests\n\nThe library can also be used to perform \"backoffice\" requests. These\nrequests are initiated without direct involvement of users and are\nmeant for administrative purposes. Your client needs to have the\n`backoffice_code` grant type allowed. You also need to know the ID of\nthe user you want to work with.\n\nBackoffice requests are used to make an API calls on behalf of other users. To get access token for these requests\nyou need to use special grant type 'backoffice_code' providing an account_id.\nUpon successful authentication you get a same token set as using standard flow described above.\n\n```js\nvar sevenpass = require('7pass-node-sdk');\n\nvar config = {\n  backoffice_key: 'YOUR_BACKOFFICE_KEY',\n  service_id: 'YOUR_SERVICE_ID',\n  environment: 'qa' // Optional, defaults to 'production'\n};\n\n// 1. Create and initialize the configuration object\n// Configuration object fetches OpenID Configuration and JWT public key endpoints\nsevenpass.Configuration.createAndInit(config, function(err, ssoConfig) {\n  if(err) {\n    throw err;\n  }\n\n  // 2. Create 7Pass SSO object passing initialized Configuration object\n  var sso = new sevenpass.SSO(ssoConfig);\n\n  // 3. Get the tokens using the backoffice\n  sso.authorization().backoffice({\n    account_id: 'ACCOUNT_ID' // Required, the ID of the user you want to access\n  }, handleBackofficeAuthorization);\n});\n\nfunction handleBackofficeAuthorization(err, tokens) {\n  if(err) {\n    throw err;\n  }\n\n  // 4. Use the client as you normally would when using the standard access\n  var aaccountClient = sso.accountClient(tokens);\n  accountClient.get('me', function(err, data) {\n    //handle response\n  });\n}\n```\n\nThe response will be as usual. Once you get the tokens, the 7Pass SSO\nservice will act as if the access token has been obtained using the\n\"standard\" way.\n\n## Client/backoffice registration\n\nWhen you register new users using the\n[client or backoffice registration API](http://guide.docs.7pass.ctf.prosiebensat1.com/api/index.html#api-Accounts-ActionSessionRegistration),\nyou might want to bounce them to the 7Pass SSO service so that the user's session is created and the user logged in.\n\nThis SDK provides a method called `autologinUri()` which can be used to generate the redirect (bounce) URL.\nThe method accepts a `TokenSet` as its first parameter. You can retrieve the user's tokens when using the registration API\nby providing the `scope` parameter. See the [registration API](http://guide.docs.7pass.ctf.prosiebensat1.com/api/index.html#api-Accounts-ActionSessionRegistration)\ndocumentation for more details. `response_type` defaults to `none` but can be set to any other\n[supported type](http://guide.docs.7pass.ctf.prosiebensat1.com/api/index.html#api-OpenID_Connect-OpenIDAuthorize) if needed so.\n\n```js\n// client is an instance of ApiClient created using sso.clientCredentialsClient() or sso.backofficeClient() methods.\nclient.post('registration', {\n    scope: 'openid profile email'\n    // other parameters\n}, function(err, response) {\n    //handle error\n    \n    var tokens = TokenSet.receiveTokens(response);\n    \n    var uri = sso.authorization().autologinUri(tokens, {\n        redirect_uri: callbackUri, // Required\n        state: sessionState // Optional but recommended to use\n    }, {\n        remember_me: true // Default value: false\n    });\n    \n    // Redirect user to uri\n});\n```\n\nAs with other ordinary authorize requests, you can use `sso.authorization().callback()` method\nto handle a callback request. The callback receives null if `response_type` was set to `none`.\n\n## Running the tests\n\nThe library uses mocha for testing.\n\n```\nnpm test\n```\n","maintainers":[{"email":"philipp.ebner@prosiebensat1.com","name":"p7s1-ctf"}],"time":{"modified":"2022-06-12T14:08:37.753Z","created":"2015-10-27T16:04:40.709Z","1.0.0":"2015-10-27T16:04:40.709Z","1.0.1":"2015-10-28T08:41:00.933Z","1.0.2":"2015-11-02T10:21:20.605Z","1.1.0":"2016-02-02T14:57:12.510Z","1.2.0":"2016-03-18T10:14:05.567Z","1.2.1":"2016-04-15T12:34:51.338Z","1.3.0":"2016-05-13T14:26:01.264Z","1.3.1":"2016-11-03T12:31:46.275Z","1.3.2":"2016-11-03T12:41:00.669Z","1.3.3":"2016-11-14T12:13:15.827Z","2.0.0":"2017-10-24T12:00:13.208Z","2.0.1":"2018-08-21T07:44:10.133Z"},"homepage":"https://github.com/p7s1-ctf/7pass-nodejs-sdk#readme","repository":{"type":"git","url":"git+ssh://git@github.com/p7s1-ctf/7pass-nodejs-sdk.git"},"author":{"name":"7Pass Development Team"},"bugs":{"url":"https://github.com/p7s1-ctf/7pass-nodejs-sdk/issues"},"license":"MIT","readmeFilename":"README.md"}