{"_id":"@outlinewiki/passport-azure-ad-oauth2","_rev":"1-3e11353ae779c919b58a342147b16f61","name":"@outlinewiki/passport-azure-ad-oauth2","dist-tags":{"latest":"0.1.0"},"versions":{"0.1.0":{"name":"@outlinewiki/passport-azure-ad-oauth2","version":"0.1.0","description":"Passport strategy for authenticating with Azure AD using the OAuth 2.0 protocol.","keywords":["passport","waad","oauth","azure active directory","azure ad","auth","authn","authentication","identity"],"repository":{"type":"git","url":"git://github.com/outline/passport-azure-ad-oauth2.git"},"bugs":{"url":"http://github.com/outline/passport-azure-ad-oauth2/issues"},"author":{"name":"Auth0","email":"support@auth0.com","url":"http://www.auth0.com/"},"licenses":[{"type":"MIT","url":"http://www.opensource.org/licenses/MIT"}],"main":"./lib/passport-azure-ad-oauth2","dependencies":{"passport-oauth":"1.0.x"},"devDependencies":{"mocha":"1.x.x","chai":"1.x.x"},"scripts":{"test":"mocha --reporter spec test/*.test.js"},"homepage":"https://github.com/outline/passport-azure-ad-oauth2","gitHead":"e83d868afe34cc28de765baed1f7193b3bc26b33","_id":"@outlinewiki/passport-azure-ad-oauth2@0.1.0","_nodeVersion":"15.14.0","_npmVersion":"7.7.6","dist":{"integrity":"sha512-9tywL/KToBgolno7ZaT4/c4bRromldi/HemPB3BN3KPJyqhJG+dii3lJRsbeRF9UF+FGlm5ifmONMFLVetdZWA==","shasum":"29e8dc238c86b7e390997fc3db9accef4118a765","tarball":"https://registry.npmjs.org/@outlinewiki/passport-azure-ad-oauth2/-/passport-azure-ad-oauth2-0.1.0.tgz","fileCount":7,"unpackedSize":11304,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgeyMpCRA9TVsSAnZWagAAK1MP/RgWVrzQPdueiSx4nqGA\n4HlDpp2YQ/2PS9AZmorSIZnhDoujHNqkYpS7EMLUcsFXXF99Xcd3MgekWYwE\nQhqyId/rIEDk3y0KWnqqP0knG4Eu6/UyxVhnwcqmQ8/UgFuNDQzm3arNzbFq\n94Yd6m1mC24eNPVBBP1eNXg/XwC9LuU4dnBOHlnmHcBTXo02/SQj0Kyk/FGE\neJ7bYaps7EbXVvBIvcWwOVLCWayp8gcNpmA67YWmtTgXQXb8cLcXQkgZoF8j\ngqad34PX3E8so06Iwwx2zR5V0asAcun+6ehHfZ/CG/s6PFClBLA8R3BU3LlK\ndK12vofyNKAYDlJ9W0G/JB4+/iSlMj5FWbapICSKUFNba0Q4KwBqt4gdEBjB\nwWHLd2ZrNViFWHExBPcXu712ZHrJeqx+XKFfCVfW4luhKpSLDXCJYoeXaD61\npjY8AcS2zNTZca0zuJE7OGbeDZE2qL+qil0ycJltl3FiGU1f3JENdNQH7K7a\nnAW54zN0V+aEYqjpqHQri1/kA0Wtx+my0sg/ey4b1YBVelysWkaLJqD7B3lM\n8gzaT6t8hXP/L7PjwS7Ws3YFQVxXcS3yS4RjjmAI9eJ0LWUswBrenYE9ALQe\n2Vj2/Fu+BjulK6beUeb6sOoXdfI9CCu0f9Wxi7PMfGeC7ovNYLHuOGjQJzqA\n5MkE\r\n=kWVe\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGa/XvU/kl/Ysk0PHfMe5N3YwSUy5ukIH+JGF3waVXDdAiEA9/KRfdsi3omd790m9QXD3X6rfgk6DjokPcQHJvKQvmY="}]},"_npmUser":{"name":"tommoor","email":"tom.moor@gmail.com"},"directories":{},"maintainers":[{"name":"tommoor","email":"tom.moor@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/passport-azure-ad-oauth2_0.1.0_1618682665009_0.702333002591407"},"_hasShrinkwrap":false}},"time":{"created":"2021-04-17T18:04:24.777Z","0.1.0":"2021-04-17T18:04:25.146Z","modified":"2022-04-06T12:31:53.849Z"},"maintainers":[{"name":"tommoor","email":"tom.moor@gmail.com"}],"description":"Passport strategy for authenticating with Azure AD using the OAuth 2.0 protocol.","homepage":"https://github.com/outline/passport-azure-ad-oauth2","keywords":["passport","waad","oauth","azure active directory","azure ad","auth","authn","authentication","identity"],"repository":{"type":"git","url":"git://github.com/outline/passport-azure-ad-oauth2.git"},"author":{"name":"Auth0","email":"support@auth0.com","url":"http://www.auth0.com/"},"bugs":{"url":"http://github.com/outline/passport-azure-ad-oauth2/issues"},"readme":"# Passport-azure-ad-oauth2\n\n[Passport](http://passportjs.org/) strategy for authenticating with [Azure AD](http://msdn.microsoft.com/en-us/library/azure/dn645545.aspx)\nusing the OAuth 2.0 protocol.\n\n## Install\n\n    $ npm install @outlinewiki/passport-azure-ad-oauth2\n\n## Usage\n\n#### Configure Strategy\n\nThe Azure AD OAuth 2.0 authentication strategy authenticates requests by delegating to Azure AD using the OAuth 2.0 protocol.\n\nApplications must supply a `verify` callback which accepts an `accessToken`, `refresh_token`, `params` and service-specific `profile`, and then calls the `done` callback supplying a `user`, which should be set to `false` if the credentials are not valid.  If an exception occured, `err` should be set.\n\n##### Options\n\n* `clientID`: specifies the client id of the application that is registered in Azure Active Directory.\n* `clientSecret`: secret used to establish ownership of the client Id.\n* `callbackURL`: URL to which Azure AD will redirect the user after obtaining authorization.\n* `resource`: [optional] the App ID URI of the web API (secured resource).\n* `tenant`: [optional] tenant domain (e.g.: contoso.onmicrosoft.com).\n* `useCommonEndpoint`: [optional] use \"https://login.microsoftonline.com/common\" instead of default endpoint (https://login.microsoftonline.com/{tenant}). This is typically enabled if you're using this for a Multi-tenant application in Azure AD (Default: `false`).\n\n```javascript\npassport.use(new AzureAdOAuth2Strategy({\n  clientID: '{YOUR_CLIENT_ID}',\n  clientSecret: '{YOUR_CLIENT_SECRET}',\n  callbackURL: 'https://www.example.net/auth/azureadoauth2/callback',\n  resource: '00000002-0000-0000-c000-000000000000',\n  tenant: 'contoso.onmicrosoft.com'\n},\nfunction (accessToken, refresh_token, params, profile, done) {\n  // currently we can't find a way to exchange access token by user info (see userProfile implementation), so\n  // you will need a jwt-package like https://github.com/auth0/node-jsonwebtoken to decode id_token and get waad profile\n  var waadProfile = profile || jwt.decode(params.id_token);\n\n  // this is just an example: here you would provide a model *User* with the function *findOrCreate*\n  User.findOrCreate({ id: waadProfile.upn }, function (err, user) {\n    done(err, user);\n  });\n}));\n```\n\n#### Authenticate Requests\n\nUse `passport.authenticate()`, specifying the `'azure'` strategy, to authenticate requests.\n\nFor example, as route middleware in an [Express](http://expressjs.com/) application:\n\n```javascript\napp.get('/auth/azureadoauth2',\n  passport.authenticate('azure'));\n\napp.get('/auth/azureadoauth2/callback', \n  passport.authenticate('azure', { failureRedirect: '/login' }),\n  function (req, res) {\n    // Successful authentication, redirect home.\n    res.redirect('/');\n  });\n```\n\n## Tests\n\n    $ npm install\n    $ npm test\n    \n## Issue Reporting\n\nIf you have found a bug or if you have a feature request, please report them at this repository issues section. Please do not report security vulnerabilities on the public GitHub issue tracker. The [Responsible Disclosure Program](https://auth0.com/whitehat) details the procedure for disclosing security issues.\n\n## Credits\n\n  - [Jared Hanson](http://github.com/jaredhanson)\n  - [Azure AD Team](https://github.com/AzureAD/azure-activedirectory-library-for-nodejs)\n\n## Issue Reporting\n\nIf you have found a bug or if you have a feature request, please report them at this repository issues section. Please do not report security vulnerabilities on the public GitHub issue tracker. The [Responsible Disclosure Program](https://auth0.com/whitehat) details the procedure for disclosing security issues.\n\n## Author\n\n[Auth0](auth0.com)\n\n## License\n\nThis project is licensed under the MIT license. See the [LICENSE](LICENSE) file for more info.\n","readmeFilename":"README.md"}