{"_id":"@antoniojps/passport-identityua","_rev":"1-2d760a45004f410838077f104cefd271","name":"@antoniojps/passport-identityua","dist-tags":{"latest":"2.0.0"},"versions":{"2.0.0":{"name":"@antoniojps/passport-identityua","version":"2.0.0","description":"University of Aveiro authentication strategy for Passport.","keywords":["passport","ua","auth","authn","authentication","identity"],"author":{"name":"Antonio Santos"},"repository":{"type":"git","url":"git+ssh://git@github.com/antoniojps/passport-identityua.git"},"bugs":{"url":"https://github.com/antoniojps/passport-identityua/issues"},"license":"MIT","licenses":[{"type":"MIT","url":"http://www.opensource.org/licenses/MIT"}],"main":"./lib","dependencies":{"passport-oauth1":"1.x.x","xtraverse":"0.1.x"},"devDependencies":{"mocha":"1.x.x","chai":"1.x.x","chai-passport-strategy":"0.1.x"},"engines":{"node":">= 0.4.0"},"scripts":{"test":"mocha --reporter spec --require test/bootstrap/node test/*.test.js"},"prettier":{"semi":true,"trailingComma":"none","jsxBracketSameLine":false,"singleQuote":false,"tabWidth":2,"printWidth":80},"gitHead":"7f09b5778d43cd3fd5b56176790a4f0805ae628a","homepage":"https://github.com/antoniojps/passport-identityua#readme","_id":"@antoniojps/passport-identityua@2.0.0","_nodeVersion":"11.8.0","_npmVersion":"6.9.0","dist":{"integrity":"sha512-kXhLLm9xH2en6oDBUUxyZxM4DLaxSBlEyWQRpxNmU6Fm5eLOauMxxMeYtmioEhhP8Pl5XUt59gcCJ6RGsAjEVw==","shasum":"b8c81dbde20647aa958c83ae631e0aeedad1e21e","tarball":"https://registry.npmjs.org/@antoniojps/passport-identityua/-/passport-identityua-2.0.0.tgz","fileCount":6,"unpackedSize":12135,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdPtO5CRA9TVsSAnZWagAANR0P/0OdW0hXyNiLkERZ+hPC\nHJfnwrxDEhKNwiTU3YGkkQLXb68wvXucMaRvzbXxTk2di/UU+5WVjISSMKFN\nDgRqkI4mvbIl/qg6XBCtiS1gPqziwKaiOVih0J0RrYjCImwj6UaGq/t/6+Mq\nodSemOh5emjwDJQKhtOQoLvFwhi2RI6eLBDmVAOdyoPps/N+goczwN5AXU6i\naiuchcjmyjqpkHjC8ax5S66PH0uTFVlIQIZ5DvTLPadSVU1Onp0dAfJrymh3\nceQASoct0PbGxqaoUU6u92N/6myo0idAWSH3QPMC2UWYjWR5Ywq4C/00n7g6\noRednuYuxM0bg5VWRXoWoHsQgpp+FIITCs17U2TZNLRjkphfmNseufZyp1di\nF/Gc4IN/ezgZZUKvx1np9TYf3TJoFHTu3ubE3qMCZGS9B8VbADS12g+xgPny\nxZno/ZiCUc8UelEFuG6DeFrErZ9rH43yY/HRHnx35loROf6osKDCZfjMHKb8\nbJp9vlAdw9ZwEMJ/NZfeC2SnGEtFdsiYOhWqP5e0IFpxR26LZN9NwHAvQtnF\nBQfRugAFqpc0zNk3yYAdeFWnh4Xakag8JjCuM+LkUArAjbYIyXk+Jb32t1DR\nC6+oMZQ6zcAwdaQXXXOtVD6F5t6IQSxYxvwHszTw0iu/OjC9RAOILs8Dl5NF\n5QEh\r\n=KAf7\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCpX+aEF+E28jsucgeyH5o86OTXjgSmvCtKQ9RDL1rg9AIgGDgoAHxRhGTTR8JzOYlFMUCnX/dfZ+BgrH+2aldYn0Q="}]},"maintainers":[{"name":"antoniojps","email":"xixinhora@gmail.com"}],"_npmUser":{"name":"antoniojps","email":"xixinhora@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/passport-identityua_2.0.0_1564398521289_0.32796527437542733"},"_hasShrinkwrap":false}},"time":{"created":"2019-07-29T11:08:41.062Z","2.0.0":"2019-07-29T11:08:41.390Z","modified":"2022-04-04T14:23:18.806Z"},"maintainers":[{"name":"antoniojps","email":"xixinhora@gmail.com"}],"description":"University of Aveiro authentication strategy for Passport.","homepage":"https://github.com/antoniojps/passport-identityua#readme","keywords":["passport","ua","auth","authn","authentication","identity"],"repository":{"type":"git","url":"git+ssh://git@github.com/antoniojps/passport-identityua.git"},"author":{"name":"Antonio Santos"},"bugs":{"url":"https://github.com/antoniojps/passport-identityua/issues"},"license":"MIT","readme":"# passport-identityua\n\n[![npm](https://img.shields.io/npm/v/npm.svg)](https://www.npmjs.com/package/passport-identityua)\n[![Build Status](https://travis-ci.org/poliveira89/passport-identityua.svg)](https://travis-ci.org/poliveira89/passport-identityua)\n[![Coverage Status](https://coveralls.io/repos/poliveira89/passport-identityua/badge.svg?branch=master&service=github)](https://coveralls.io/github/poliveira89/passport-identityua?branch=master)\n[![Codacy Badge](https://api.codacy.com/project/badge/d20ac5ee14e1494a80716b7b16e637c8)](https://www.codacy.com/app/paulonascimento89/passport-identityua)\n[![Code Climate](https://codeclimate.com/github/poliveira89/passport-identityua/badges/gpa.svg)](https://codeclimate.com/github/poliveira89/passport-identityua)\n[![Dependencies](https://david-dm.org/poliveira89/passport-identityua.svg)](https://david-dm.org/poliveira89/passport-identityua)\n\n[Passport](http://passportjs.org/) strategy for authenticating with [IdentityUA](http://identity.ua.pt/)\nusing the OAuth 1.0a API.\n\nThis module lets you authenticate using Universal User from University of Aveiro (UA) in your Node.js applications.\n\n## Install\n\n    $ npm install passport-identityua\n\n## Usage\n\n#### Configure Strategy\n\nThe IdentityUA authentication strategy authenticates users using a Universal User UA account\nand OAuth tokens. The strategy requires a `verify` callback, which receives the\naccess token and corresponding secret as arguments, as well as `profile` which\ncontains the authenticated user's UA profile. The `verify` callback must\ncall `done` providing a user to complete authentication.\n\nIn order to identify your application to IdentityUA, specify the consumer key,\nconsumer secret, callback URL and scope within `options`. The consumer key and secret\nare obtained by [creating an application](http://identity.ua.pt/oauth/apps) at\nIdentityUA site.\n\n```js\npassport.use(\n  new IdentityUaStrategy(\n    {\n      consumerKey: IDENTITYUA_CONSUMER_KEY,\n      consumerSecret: IDENTITYUA_CONSUMER_SECRET,\n      callbackURL: \"http://127.0.0.1:3000/auth/ua/callback\"\n    },\n    function(token, tokenSecret, profile, done) {\n      User.findOrCreate({ id: profile.id }, function(err, user) {\n        return done(err, user);\n      });\n    }\n  )\n);\n```\n\nWhen the scope option is undefined it defaults to `uu` (Utilizador universal) which returns the user's email.\n\n#### Scopes\n\nThe following example demonstrastes the usage of `scopes`.\n\n```js\npassport.use(\n  new IdentityUaStrategy(\n    {\n      consumerKey: IDENTITYUA_CONSUMER_KEY,\n      consumerSecret: IDENTITYUA_CONSUMER_SECRET,\n      callbackURL: \"http://127.0.0.1:3000/auth/ua/callback\",\n      scope: [\"uu\", \"name\"]\n    },\n    function(token, tokenSecret, profile, done) {\n      User.findOrCreate({ id: profile.id }, function(err, user) {\n        return done(err, user);\n      });\n    }\n  )\n);\n```\n\nRead the [OAuth service documentation](http://api.web.ua.pt/pt/services/universidade_de_aveiro/oauth) under the `Serviços Disponíveis` section to check all the available scopes.\n\n#### Authenticate Requests\n\nUse `passport.authenticate()`, specifying the `'identityua'` strategy, to\nauthenticate requests.\n\nFor example, as route middleware in an [Express](http://expressjs.com/)\napplication:\n\n```js\napp.get(\"/auth/ua\", passport.authenticate(\"identityua\"));\n\napp.get(\n  \"/auth/ua/callback\",\n  passport.authenticate(\"identityua\", { failureRedirect: \"/login\" }),\n  function(req, res) {\n    // Successful authentication, redirect home.\n    res.redirect(\"/\");\n  }\n);\n```\n\n## Tests\n\n    $ npm install\n    $ npm test\n\n## TODO\n\n- [x] Fix `scope` bug\n- [ ] Fix \"Strategy parsing error from access token endpoint parsing error should error\" test (it's hardcoded to pass)\n\n## Credits\n\n- [Jared Hanson](http://github.com/jaredhanson) (developed the code before the fork)\n- [Paulo Oliveira](http://github.com/poliveira89)\n- [António Santos](http://github.com/antoniojps)\n\n## License\n\n[The MIT License](http://opensource.org/licenses/MIT)\n\nCopyright (c) 2015 Jared Hanson <[http://jaredhanson.net/](http://jaredhanson.net/)>\n","readmeFilename":"README.md"}