{"_id":"@yoss-org/react-azure-adb2c","_rev":"31-5b9f0c61c4f49b990f697b3d61955561","name":"@yoss-org/react-azure-adb2c","dist-tags":{"latest":"0.3.2","beta":"0.2.2-lcbeta2"},"versions":{"0.2.1":{"name":"@yoss-org/react-azure-adb2c","version":"0.2.1","description":"Authentication library for Azure AD B2C and ReactJS","main":"lib/react-azure-adb2c.js","scripts":{"compile":"cross-env NODE_ENV=production babel src --out-dir lib","prepublish":"npm run compile"},"repository":{"type":"git","url":"git+https://github.com/jamesrandall/react-azure-adb2c.git"},"keywords":["react","js","AAD","B2C","oauth","azure"],"author":{"name":"Cyril HAGEGE"},"license":"MIT","bugs":{"url":"https://github.com/JamesRandall/react-azure-adb2c/issues"},"homepage":"https://github.com/JamesRandall/react-azure-adb2c#readme","dependencies":{"msal":"^0.1.5"},"peerDependencies":{"react":"^15.0.0 || ^16.0.0"},"devDependencies":{"babel-cli":"^6.26.0","babel-core":"6.24.1","babel-eslint":"^8.0.3","babel-jest":"20.0.3","babel-loader":"7.0.0","babel-plugin-import":"^1.2.1","babel-polyfill":"^6.23.0","babel-preset-env":"^1.6.1","babel-preset-react-app":"^3.0.0","babel-runtime":"6.23.0","cross-env":"^5.1.4","eslint":"^4.12.1","eslint-config-airbnb":"^16.1.0","eslint-config-defaults":"^9.0.0","eslint-plugin-import":"^2.8.0","eslint-plugin-jsx-a11y":"^6.0.2","eslint-plugin-react":"^7.5.1"},"gitHead":"749203fcd5c9dc6ecd844a227483ddda4675baa2","_id":"@yoss-org/react-azure-adb2c@0.2.1","_npmVersion":"6.2.0","_nodeVersion":"10.9.0","_npmUser":{"name":"liryc","email":"cyril@oyst.com"},"dist":{"integrity":"sha512-7d11DQ+L5VB0C6NRNwsKQH7G0nGKZiwLVM5QqkGgjf+7g920lIGF357zcKGbKh8JmL4p3X+qGJSzQtftvhtYIw==","shasum":"8a5c46f3bde448aec6d68f6dccd82fcff591d32f","tarball":"https://registry.npmjs.org/@yoss-org/react-azure-adb2c/-/react-azure-adb2c-0.2.1.tgz","fileCount":8,"unpackedSize":138981,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcDoB8CRA9TVsSAnZWagAAe0YP/io5FemNL9LyEe7ee+Wq\n8gZUdA+hF4NikCpMT5UAwQhT8lW0s7L4AfP6+zGQSCFEbuB8CH22RZSm8iWi\nDudM0NkqMTQ+UmnJvnI7rhn6nWD6aMon3zmejyGuwHBkz+juTu1qwNIzzpiC\no+8kugfySu5dS9DPnIQv//x/ITYxTkKu6POJz9lRjNaTzkdD7bkCThiULiug\nZiVowG+VY3IChouhutkRpHeWdVIast7KZYCYNAeiz/pyoUyeXu990o1AiQdZ\nJN6Wmn43QjCTCiK20DNoNWRMP/i8g+jTAV11MUVX/0ku/v0OxwYuAhJLlhfJ\nIhD6ar/JdwSEt4bVOqDi0e4SqV0GjJqbJbtXhYN0vfd2VywcylbFvLn4y4MA\nxiAhMgdCwZktxvz8LNkdoAnEX0c3szw50TwVYJKgyz4lUbwwZbYlv5cKUNNQ\nJbKHVno8S9uUg4OUNE8zd2TNFdAwRR5/tYE3bgRoFDImC2vRwrD4lc4bHOnn\ntBcI9zWkNPM8Y9BNlQC82+uHliX1Q30LLJZJg5YVccv/Tw9HhKYxQnXn8nod\n0Kzs9nQG4ebHrn1bbhBlLob6aCdPUe+mzTH5nPY6KKmE801IPTaIrF7y3BnB\nUwzEkPRKelngt7amyAjDRkYuPMWb9UvxDdl8iEz9VQgx8p5Hc8oKNCgQ71wN\ngEOc\r\n=rFoV\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDgbXN7qzXSXv6P5USc3PNtvfJ0pKuAMuNowN49PJxxjQIgCuUpNOrNJRPbXnqC7pSpzHST9Wr3M3jQgxiAuKZXYXk="}]},"maintainers":[{"name":"fhou","email":"npm@bernardle.com"},{"name":"nicolaschenet","email":"ironic51@gmail.com"},{"name":"delwiv","email":"delwiv@gmail.com"},{"name":"liryc","email":"cyril@oyst.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/react-azure-adb2c_0.2.1_1544454268161_0.648308042490038"},"_hasShrinkwrap":false},"0.3.0":{"name":"@yoss-org/react-azure-adb2c","version":"0.3.0","description":"Authentication library for Azure AD B2C and ReactJS","main":"lib/react-azure-adb2c.js","scripts":{"compile":"cross-env NODE_ENV=production babel src --out-dir lib","prepublish":"npm run compile"},"repository":{"type":"git","url":"git+https://github.com/jamesrandall/react-azure-adb2c.git"},"keywords":["react","js","AAD","B2C","oauth","azure"],"author":{"name":"Cyril HAGEGE"},"license":"MIT","bugs":{"url":"https://github.com/JamesRandall/react-azure-adb2c/issues"},"homepage":"https://github.com/JamesRandall/react-azure-adb2c#readme","dependencies":{"msal":"^0.1.5"},"peerDependencies":{"react":"^15.0.0 || ^16.0.0"},"devDependencies":{"babel-cli":"^6.26.0","babel-core":"6.24.1","babel-eslint":"^8.0.3","babel-jest":"20.0.3","babel-loader":"7.0.0","babel-plugin-import":"^1.2.1","babel-polyfill":"^6.23.0","babel-preset-env":"^1.6.1","babel-preset-react-app":"^3.0.0","babel-runtime":"6.23.0","cross-env":"^5.1.4","eslint":"^4.12.1","eslint-config-airbnb":"^16.1.0","eslint-config-defaults":"^9.0.0","eslint-plugin-import":"^2.8.0","eslint-plugin-jsx-a11y":"^6.0.2","eslint-plugin-react":"^7.5.1","eslint-plugin-sort-imports-es6-autofix":"^0.3.0"},"readme":"# README\n\nAzure AD B2C is a cost effective identity provider covering social and enterprise logins but it can be awekward to integrate with - its documentation is currently not great and using it involves rooting around across multiple samples, the ADAL library, and the MSAL library.\n\nThat being the case I've focused this package on B2C although with minor changes it could be used more broadly. MSAL itself, which this library wraps, is rather generic but B2C has some specific requirements and I think half of the problem with the documentation is that you end up drifting across B2C and straight AD. I wanted to make things simpler for B2C.\n\nHopefully this will help people writing React apps. It makes use of MSAL underneath and the core of it (other than protecting routes) will probably work with other frameworks too but I use React at the moment. As it's an SPA my assumption in the library and documentation below is that you ultimately want to get an access token that you can use to call remote APIs. See this [Azure AD B2C post here](https://docs.microsoft.com/en-us/azure/active-directory-b2c/active-directory-b2c-access-tokens) for details on how to set this up on the B2C side.\n\nPRs welcome!\n\n## Installation\n\nIf you are using npm:\n\n    npm install react-azure-adb2c --save\n\nOr if you are using yarn:\n\n    yarn add react-azure-adb2c\n\n## Initializing the Library\n\nYou'll first need to load the module and pass some configuration to the library. Normally this would go in your index.js file:\n\n    import authentication from 'react-azure-adb2c';\n    authentication.initialize({\n        // optional, will default to this\n        instance: 'https://login.microsoftonline.com/tfp/', \n        // your B2C tenant\n        tenant: 'myb2ctenant.onmicrosoft.com',\n        // the policy to use to sign in, can also be a sign up or sign in policy\n        signInPolicy: 'mysigninpolicy',\n        // the policy to use for password reset\n        resetPolicy: 'mypasswordresetpolicy',\n        // the the B2C application you want to authenticate with (that's just a random GUID - get yours from the portal)\n        applicationId: '75ee2b43-ad2c-4366-9b8f-84b7d19d776e',\n        // where MSAL will store state - localStorage or sessionStorage\n        cacheLocation: 'sessionStorage',\n        // the scopes you want included in the access token\n        scopes: ['https://myb2ctenant.onmicrosoft.com/management/admin'],\n        // optional, the redirect URI - if not specified MSAL will pick up the location from window.href\n        redirectUri: 'http://localhost:3000',\n        // optional, the URI to redirect to after logout\n        postLogoutRedirectUri: 'http://myapp.com'\n    });\n    \n## Authenticating When The App Starts\n\nIf you want to set things up so that a user is authenticated as soon as they hit your app (for example if you've got a link to an app from a landing page) then, in index.js, wrap the lines of code that launch the React app with the _authentication.run_ function:\n\n    authentication.run(() => {\n      ReactDOM.render(<App />, document.getElementById('root'));\n      registerServiceWorker();  \n    });\n\n## Triggering Authentication Based on Components Mounting (and routing)\n\nIf you want to set things up so that a user is authenticated as they visit a part of the application that requires authentication then the appropriate components can be wrapped inside higher order components that will handle the authentication process. This is done using the _authentication.required_ function, normally in conjunction with a router. The example below shows this using the popular react-router:\n\n    import React, { Component } from 'react';\n    import authentication from 'react-azure-adb2c'\n    import { BrowserRouter as Router, Route, Switch } from \"react-router-dom\";\n    import HomePage from './Homepage'\n    import MembersArea from './MembersArea'\n    \n    class App extends Component {\n      render() {\n        return (\n          <Router basename={process.env.PUBLIC_URL}>\n            <Switch>\n              <Route exact path=\"/\" component={HomePage} />\n              <Route exact path=\"/membersArea\" component={authentication.required(MembersArea)}>\n            </Switch>\n          </Router>\n        );\n      }\n    }\n\n## Getting the Access Token\n\nSimply call the method _getAccessToken_:\n\n    import authentication from 'react-azure-adb2c'\n\n    // ...\n\n    const token = authentication.getAccessToken();\n\n## Signing Out\n\nTo sign out:\n\n    import authentication from 'react-azure-adb2c'\n\n    // ...\n\n    authentication.signOut();\n\n## Thanks\n\nTo build this I made use of the B2C site, the [MSAL library docs](https://github.com/AzureAD/microsoft-authentication-library-for-js), the [react-adal source](https://github.com/salvoravida/react-adal) and this [React MSAL sample](https://github.com/sunilbandla/react-msal-sample). Thanks!\n","readmeFilename":"README.md","gitHead":"a42c70a2b540b13037b14e51d6cf9fb153604cc1","_id":"@yoss-org/react-azure-adb2c@0.3.0","_npmVersion":"6.5.0-next.0","_nodeVersion":"11.6.0","_npmUser":{"name":"delwiv","email":"delwiv@gmail.com"},"dist":{"integrity":"sha512-S1RcE2Xjduw26XSvAY6HA5FjhgnYtE+KHru3PVrfXTv0UIW275iWB1pjxFcdglEWdhvZgZcYIJ4r+p2tgJomjA==","shasum":"c29409173073e8f62904a605af7536ec6262e861","tarball":"https://registry.npmjs.org/@yoss-org/react-azure-adb2c/-/react-azure-adb2c-0.3.0.tgz","fileCount":9,"unpackedSize":173696,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcPz4QCRA9TVsSAnZWagAA1r0P/RtlVXVkiC1xwcIFTu09\nqJQoCLTVex20NQu40u8MJnfOJIqD4I8UFgaFDCI7O0hqV6oIQjQVfByhIONU\n+ijKs0+Nep7iffgCgJPBBeK8YYOCMiBe6SSliuwwVx0TOUZ0OoTpcs8MqCLp\n4zVIPIGVoxxMigxrU2AZuWDnFT8mA2w/hgYSJRgcQChyIuOYbIB4WkNbkDI9\naLfFgIR1YBaJX81urTnAUfKgc8ht9ngk8Q1cnWYXR1FrCVrbB3Yaz1uNC1kn\noquRB7vI8e6qq5Q5scmS4MEEZAhoLtvcUZ4OMckDcW/xYTsbQBrq3FJ13iGs\nc7nC2MfjEjdOYZClrG7CwzmO3Op4ks+diCZrna9vchhMfIDFoPA0nJbbRSTy\nNEqGeJ7HRJZRD0VqQXbdiiEHTIR3vTol4sm/A55AYcJU5Ys9cRS7tWTczQAC\nqtE2gUtbPp5WT5ibcz9dQzq3Pn/IrMSPP/oPZxd+egJ0ZE5wQoVSJdF+v95F\nx3I06ZpR3MWDZ/z/vIVBYTopul491epRgMN53GqGX9v5uvpAdhPM75/2neyW\n6p2NA0mHYVveGJSIIu/MG1CSSyepOD5QQMoTiGFAGcipsf/Y20L19HLy56Sm\n//9P4t3oWh3HOPka1noxrv6vR+KvLSzWbEAc6LJ+j1OO9IiH7tqHSR/ZDCpm\nZ1ix\r\n=kXfM\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC0qo1XDLlIfufUnFt1+VhKc6LBXj4vZWmBF7IOBP8vzgIhALtcVzMhLTNYO+xP61hwQnkghCtJ6opWGNdRKix0kO/U"}]},"maintainers":[{"name":"delwiv","email":"delwiv@gmail.com"},{"name":"fhou","email":"npm@bernardle.com"},{"name":"liryc","email":"cyril@oyst.com"},{"name":"nicolaschenet","email":"ironic51@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/react-azure-adb2c_0.3.0_1547648527464_0.2967594891361598"},"_hasShrinkwrap":false},"0.3.1":{"name":"@yoss-org/react-azure-adb2c","version":"0.3.1","description":"Authentication library for Azure AD B2C and ReactJS","main":"lib/react-azure-adb2c.js","scripts":{"compile":"cross-env NODE_ENV=production babel src --out-dir lib","prepublish":"npm run compile"},"repository":{"type":"git","url":"git+https://github.com/jamesrandall/react-azure-adb2c.git"},"keywords":["react","js","AAD","B2C","oauth","azure"],"author":{"name":"Cyril HAGEGE"},"license":"MIT","bugs":{"url":"https://github.com/JamesRandall/react-azure-adb2c/issues"},"homepage":"https://github.com/JamesRandall/react-azure-adb2c#readme","dependencies":{"msal":"^0.1.5"},"peerDependencies":{"react":"^15.0.0 || ^16.0.0"},"devDependencies":{"babel-cli":"^6.26.0","babel-core":"6.24.1","babel-eslint":"^8.0.3","babel-jest":"20.0.3","babel-loader":"7.0.0","babel-plugin-import":"^1.2.1","babel-polyfill":"^6.23.0","babel-preset-env":"^1.6.1","babel-preset-react-app":"^3.0.0","babel-runtime":"6.23.0","cross-env":"^5.1.4","eslint":"^4.12.1","eslint-config-airbnb":"^16.1.0","eslint-config-defaults":"^9.0.0","eslint-plugin-import":"^2.8.0","eslint-plugin-jsx-a11y":"^6.0.2","eslint-plugin-react":"^7.5.1","eslint-plugin-sort-imports-es6-autofix":"^0.3.0"},"gitHead":"c669173d963ba2c902df71ea14704422701c039a","_id":"@yoss-org/react-azure-adb2c@0.3.1","_nodeVersion":"11.6.0","_npmVersion":"6.6.0","dist":{"integrity":"sha512-NloZum0ahB3kDWSgYLNzZi3pNNaVNaL/OBZNDqh29W/cRnvDx45D9aD6SZsQVlR8xeHwBSaIwQsWI12M81lJqw==","shasum":"37c4fa5c0a7e8eff2df18be0e5a11aba4660d1fc","tarball":"https://registry.npmjs.org/@yoss-org/react-azure-adb2c/-/react-azure-adb2c-0.3.1.tgz","fileCount":9,"unpackedSize":173696,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcRzeQCRA9TVsSAnZWagAASpYP+QBltcHUrm1jfcTwNj4W\nVNriXuwQd4PWecgN7f0Uf8dpJEU0POXk6YoTuu6iy08pd45USh4RqLv/ykEM\ng09pkpuzB1OUM4CGfbCocBcvss+rkrTNg8Qc5hjqtaTiqWDW4AUB4bmPb6V6\nbWrOJCd7L9jhZkLwgE8Ys1Z5u/tTghrP+KqdQ1VemAT/hNMzY589mwbuA1KD\ndci1xt09hihQi/cUjhxpLJqZf3d79Npo8HSC1E1etGr1oH6cDvKS4Ce+vLYm\nEl/Kv6o/vNRChTDmI+lMVdm8xQmPpN4HNIvnpAO6EjgQIzQx8MvpaH8lnuMR\npIDTKojDDA3VRs94J7BVlVuSfgY9Tv8Ac2lbhTMtFMToRMydNMFIiSRcPmOG\nvnsZkd0xpXQxKZbOIrRXHgrVkOHHDUIfdzt7qjDc7C6dTN3gA4cucb1xRdL/\nSHwUGJFCz4c/P3NNc8T1YFF8po7kAqxwIvEo+ManZq3N3a4005HzD6/nd6d4\nhrJ8GbSk58eH6ktPgR4BPwmB/cOwJ06eUSI+PnArRi94bZ947ZPGS3rftlTk\ny2lcAkVCgy1TdrW//0DO2huPhpVZvEsyjZu2xgI6iVN9KUsPn9fVXetQjCDo\nkIDZouNwmkXsD4qIiR0+Tqd+uwSvdaWQdY8/xFI1bq+GJB6e6cI6eVegxdxn\n80Un\r\n=nWLc\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCue7k3wbT130fcEe9Rc54tTpRdNeqBlia287RwMbVO8wIhAIQ5DeRkty3Y8S71x6Vv0pBepVLgsVjf/6GxrzUNFTTw"}]},"maintainers":[{"name":"delwiv","email":"delwiv@gmail.com"},{"name":"fhou","email":"npm@bernardle.com"},{"name":"liryc","email":"cyril@oyst.com"},{"name":"nicolaschenet","email":"ironic51@gmail.com"}],"_npmUser":{"name":"delwiv","email":"delwiv@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/react-azure-adb2c_0.3.1_1548171152183_0.6675776945583354"},"_hasShrinkwrap":false},"0.3.2-lcbeta1":{"name":"@yoss-org/react-azure-adb2c","version":"0.3.2-lcbeta1","description":"Authentication library for Azure AD B2C and ReactJS","main":"lib/react-azure-adb2c.js","scripts":{"compile":"cross-env NODE_ENV=production babel src --out-dir lib","prepublish":"npm run compile"},"repository":{"type":"git","url":"git+https://github.com/jamesrandall/react-azure-adb2c.git"},"keywords":["react","js","AAD","B2C","oauth","azure"],"author":{"name":"Cyril HAGEGE"},"license":"MIT","bugs":{"url":"https://github.com/JamesRandall/react-azure-adb2c/issues"},"homepage":"https://github.com/JamesRandall/react-azure-adb2c#readme","dependencies":{"msal":"^0.1.5"},"peerDependencies":{"react":"^15.0.0 || ^16.0.0"},"devDependencies":{"babel-cli":"^6.26.0","babel-core":"6.24.1","babel-eslint":"^8.0.3","babel-jest":"20.0.3","babel-loader":"7.0.0","babel-plugin-import":"^1.2.1","babel-polyfill":"^6.23.0","babel-preset-env":"^1.6.1","babel-preset-react-app":"^3.0.0","babel-runtime":"6.23.0","cross-env":"^5.1.4","eslint":"^4.12.1","eslint-config-airbnb":"^16.1.0","eslint-config-defaults":"^9.0.0","eslint-plugin-import":"^2.8.0","eslint-plugin-jsx-a11y":"^6.0.2","eslint-plugin-react":"^7.5.1","eslint-plugin-sort-imports-es6-autofix":"^0.3.0"},"readme":"# README\n\nAzure AD B2C is a cost effective identity provider covering social and enterprise logins but it can be awekward to integrate with - its documentation is currently not great and using it involves rooting around across multiple samples, the ADAL library, and the MSAL library.\n\nThat being the case I've focused this package on B2C although with minor changes it could be used more broadly. MSAL itself, which this library wraps, is rather generic but B2C has some specific requirements and I think half of the problem with the documentation is that you end up drifting across B2C and straight AD. I wanted to make things simpler for B2C.\n\nHopefully this will help people writing React apps. It makes use of MSAL underneath and the core of it (other than protecting routes) will probably work with other frameworks too but I use React at the moment. As it's an SPA my assumption in the library and documentation below is that you ultimately want to get an access token that you can use to call remote APIs. See this [Azure AD B2C post here](https://docs.microsoft.com/en-us/azure/active-directory-b2c/active-directory-b2c-access-tokens) for details on how to set this up on the B2C side.\n\nPRs welcome!\n\n## Installation\n\nIf you are using npm:\n\n    npm install react-azure-adb2c --save\n\nOr if you are using yarn:\n\n    yarn add react-azure-adb2c\n\n## Initializing the Library\n\nYou'll first need to load the module and pass some configuration to the library. Normally this would go in your index.js file:\n\n    import authentication from 'react-azure-adb2c';\n    authentication.initialize({\n        // optional, will default to this\n        instance: 'https://login.microsoftonline.com/tfp/', \n        // your B2C tenant\n        tenant: 'myb2ctenant.onmicrosoft.com',\n        // the policy to use to sign in, can also be a sign up or sign in policy\n        signInPolicy: 'mysigninpolicy',\n        // the policy to use for password reset\n        resetPolicy: 'mypasswordresetpolicy',\n        // the the B2C application you want to authenticate with (that's just a random GUID - get yours from the portal)\n        applicationId: '75ee2b43-ad2c-4366-9b8f-84b7d19d776e',\n        // where MSAL will store state - localStorage or sessionStorage\n        cacheLocation: 'sessionStorage',\n        // the scopes you want included in the access token\n        scopes: ['https://myb2ctenant.onmicrosoft.com/management/admin'],\n        // optional, the redirect URI - if not specified MSAL will pick up the location from window.href\n        redirectUri: 'http://localhost:3000',\n        // optional, the URI to redirect to after logout\n        postLogoutRedirectUri: 'http://myapp.com'\n    });\n    \n## Authenticating When The App Starts\n\nIf you want to set things up so that a user is authenticated as soon as they hit your app (for example if you've got a link to an app from a landing page) then, in index.js, wrap the lines of code that launch the React app with the _authentication.run_ function:\n\n    authentication.run(() => {\n      ReactDOM.render(<App />, document.getElementById('root'));\n      registerServiceWorker();  \n    });\n\n## Triggering Authentication Based on Components Mounting (and routing)\n\nIf you want to set things up so that a user is authenticated as they visit a part of the application that requires authentication then the appropriate components can be wrapped inside higher order components that will handle the authentication process. This is done using the _authentication.required_ function, normally in conjunction with a router. The example below shows this using the popular react-router:\n\n    import React, { Component } from 'react';\n    import authentication from 'react-azure-adb2c'\n    import { BrowserRouter as Router, Route, Switch } from \"react-router-dom\";\n    import HomePage from './Homepage'\n    import MembersArea from './MembersArea'\n    \n    class App extends Component {\n      render() {\n        return (\n          <Router basename={process.env.PUBLIC_URL}>\n            <Switch>\n              <Route exact path=\"/\" component={HomePage} />\n              <Route exact path=\"/membersArea\" component={authentication.required(MembersArea)}>\n            </Switch>\n          </Router>\n        );\n      }\n    }\n\n## Getting the Access Token\n\nSimply call the method _getAccessToken_:\n\n    import authentication from 'react-azure-adb2c'\n\n    // ...\n\n    const token = authentication.getAccessToken();\n\n## Signing Out\n\nTo sign out:\n\n    import authentication from 'react-azure-adb2c'\n\n    // ...\n\n    authentication.signOut();\n\n## Thanks\n\nTo build this I made use of the B2C site, the [MSAL library docs](https://github.com/AzureAD/microsoft-authentication-library-for-js), the [react-adal source](https://github.com/salvoravida/react-adal) and this [React MSAL sample](https://github.com/sunilbandla/react-msal-sample). Thanks!\n","readmeFilename":"README.md","gitHead":"59a4e227b1a09558baa03216f08939eb2a78d82f","_id":"@yoss-org/react-azure-adb2c@0.3.2-lcbeta1","_nodeVersion":"11.6.0","_npmVersion":"6.6.0","dist":{"integrity":"sha512-qVc2Rm5alYUB95fNnTg9bF8v8jxywIgyd11xomrVXgbiByF03Za9OvsS6NOYQmH9746SIj3iB+HUtZnpBr1tvw==","shasum":"e3b7c7f8eabf796a906fabfdf238c8b46f5a15c0","tarball":"https://registry.npmjs.org/@yoss-org/react-azure-adb2c/-/react-azure-adb2c-0.3.2-lcbeta1.tgz","fileCount":9,"unpackedSize":174093,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcSK4QCRA9TVsSAnZWagAAHLMP/jxnVwP4yaxyilwufq5/\nJlfTLfj9iBwWpC16PHYwNDGCmENaxZAeIvx0jJIlPO/UtTCx0/ZZW2SmTSMs\noU0tAmmt1r78vFbYr8wtF6bW/PXWLYvdjsrUNvXG3fGeRc7X8PUT/usuDzS4\n6Jq97Pty+8lL+A5GLHrsUutOX4e0eN7s6ESCLTnvXBL1CZr8V5KlYXJHvIx3\nUSZbdYWA9tGtS2zEUwpO4DevPUB/jr8N5wSCFUuZNO7Eq2gbvZBeophV6H/W\nkT0mnxt5ROfOCbhL9iwive9ebryWG46FSfpTMpIM1o82jxo0YQeiNL3Zq6NK\nC67RgxRQZuPJx23bvC5CTFk9BUVWrnnPN9Pgcbvxkgpwi0/O4hj/BSQmnYCn\nA4rCY/bGqJVvIxhx8INurqekRCLYe6F6o3k8vJL7YvUelL5oNrLtiWjIOO8v\njc1Sg0kUkB4Kvu0qPTak1g4abtJqRkOyGSZ3YCGJRnlmuu2qVpbmR+YQLaf9\nEPQ71XZT0vo/f2rY5BrhDXv/PaifL8Q7zaXexGeVU5HHziX9+UY6vOHsnnnS\nyy7aFu1Ss9T1w0+HasbtvPMJ9qD/Ziwm0FP3+vr5KeK9lcmEa6ZbEv7kMnNj\nqKZgDbss5Tal5JJQorkMok/cc+9ImlNU5aAC44/OytykVIhyKOzRiTeUxt2m\nDVs4\r\n=42t4\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDhrPrBuwqUtDvtngTIXa7vdF9E9KQISkjCtwTpb7FrBgIgJ36FzCPim4T+Udaborls2hXzDAF6esGeDRk8FTHuYa8="}]},"maintainers":[{"name":"delwiv","email":"delwiv@gmail.com"},{"name":"fhou","email":"npm@bernardle.com"},{"name":"liryc","email":"cyril@oyst.com"},{"name":"nicolaschenet","email":"ironic51@gmail.com"}],"_npmUser":{"name":"delwiv","email":"delwiv@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/react-azure-adb2c_0.3.2-lcbeta1_1548267024387_0.3051549132696081"},"_hasShrinkwrap":false},"0.3.2-lcbeta2":{"name":"@yoss-org/react-azure-adb2c","version":"0.3.2-lcbeta2","description":"Authentication library for Azure AD B2C and ReactJS","main":"lib/react-azure-adb2c.js","scripts":{"compile":"cross-env NODE_ENV=production babel src --out-dir lib","prepublish":"npm run compile"},"repository":{"type":"git","url":"git+https://github.com/jamesrandall/react-azure-adb2c.git"},"keywords":["react","js","AAD","B2C","oauth","azure"],"author":{"name":"Cyril HAGEGE"},"license":"MIT","bugs":{"url":"https://github.com/JamesRandall/react-azure-adb2c/issues"},"homepage":"https://github.com/JamesRandall/react-azure-adb2c#readme","dependencies":{"msal":"^0.1.5"},"peerDependencies":{"react":"^15.0.0 || ^16.0.0"},"devDependencies":{"babel-cli":"^6.26.0","babel-core":"6.24.1","babel-eslint":"^8.0.3","babel-jest":"20.0.3","babel-loader":"7.0.0","babel-plugin-import":"^1.2.1","babel-polyfill":"^6.23.0","babel-preset-env":"^1.6.1","babel-preset-react-app":"^3.0.0","babel-runtime":"6.23.0","cross-env":"^5.1.4","eslint":"^4.12.1","eslint-config-airbnb":"^16.1.0","eslint-config-defaults":"^9.0.0","eslint-plugin-import":"^2.8.0","eslint-plugin-jsx-a11y":"^6.0.2","eslint-plugin-react":"^7.5.1","eslint-plugin-sort-imports-es6-autofix":"^0.3.0"},"readme":"# README\n\nAzure AD B2C is a cost effective identity provider covering social and enterprise logins but it can be awekward to integrate with - its documentation is currently not great and using it involves rooting around across multiple samples, the ADAL library, and the MSAL library.\n\nThat being the case I've focused this package on B2C although with minor changes it could be used more broadly. MSAL itself, which this library wraps, is rather generic but B2C has some specific requirements and I think half of the problem with the documentation is that you end up drifting across B2C and straight AD. I wanted to make things simpler for B2C.\n\nHopefully this will help people writing React apps. It makes use of MSAL underneath and the core of it (other than protecting routes) will probably work with other frameworks too but I use React at the moment. As it's an SPA my assumption in the library and documentation below is that you ultimately want to get an access token that you can use to call remote APIs. See this [Azure AD B2C post here](https://docs.microsoft.com/en-us/azure/active-directory-b2c/active-directory-b2c-access-tokens) for details on how to set this up on the B2C side.\n\nPRs welcome!\n\n## Installation\n\nIf you are using npm:\n\n    npm install react-azure-adb2c --save\n\nOr if you are using yarn:\n\n    yarn add react-azure-adb2c\n\n## Initializing the Library\n\nYou'll first need to load the module and pass some configuration to the library. Normally this would go in your index.js file:\n\n    import authentication from 'react-azure-adb2c';\n    authentication.initialize({\n        // optional, will default to this\n        instance: 'https://login.microsoftonline.com/tfp/', \n        // your B2C tenant\n        tenant: 'myb2ctenant.onmicrosoft.com',\n        // the policy to use to sign in, can also be a sign up or sign in policy\n        signInPolicy: 'mysigninpolicy',\n        // the policy to use for password reset\n        resetPolicy: 'mypasswordresetpolicy',\n        // the the B2C application you want to authenticate with (that's just a random GUID - get yours from the portal)\n        applicationId: '75ee2b43-ad2c-4366-9b8f-84b7d19d776e',\n        // where MSAL will store state - localStorage or sessionStorage\n        cacheLocation: 'sessionStorage',\n        // the scopes you want included in the access token\n        scopes: ['https://myb2ctenant.onmicrosoft.com/management/admin'],\n        // optional, the redirect URI - if not specified MSAL will pick up the location from window.href\n        redirectUri: 'http://localhost:3000',\n        // optional, the URI to redirect to after logout\n        postLogoutRedirectUri: 'http://myapp.com'\n    });\n    \n## Authenticating When The App Starts\n\nIf you want to set things up so that a user is authenticated as soon as they hit your app (for example if you've got a link to an app from a landing page) then, in index.js, wrap the lines of code that launch the React app with the _authentication.run_ function:\n\n    authentication.run(() => {\n      ReactDOM.render(<App />, document.getElementById('root'));\n      registerServiceWorker();  \n    });\n\n## Triggering Authentication Based on Components Mounting (and routing)\n\nIf you want to set things up so that a user is authenticated as they visit a part of the application that requires authentication then the appropriate components can be wrapped inside higher order components that will handle the authentication process. This is done using the _authentication.required_ function, normally in conjunction with a router. The example below shows this using the popular react-router:\n\n    import React, { Component } from 'react';\n    import authentication from 'react-azure-adb2c'\n    import { BrowserRouter as Router, Route, Switch } from \"react-router-dom\";\n    import HomePage from './Homepage'\n    import MembersArea from './MembersArea'\n    \n    class App extends Component {\n      render() {\n        return (\n          <Router basename={process.env.PUBLIC_URL}>\n            <Switch>\n              <Route exact path=\"/\" component={HomePage} />\n              <Route exact path=\"/membersArea\" component={authentication.required(MembersArea)}>\n            </Switch>\n          </Router>\n        );\n      }\n    }\n\n## Getting the Access Token\n\nSimply call the method _getAccessToken_:\n\n    import authentication from 'react-azure-adb2c'\n\n    // ...\n\n    const token = authentication.getAccessToken();\n\n## Signing Out\n\nTo sign out:\n\n    import authentication from 'react-azure-adb2c'\n\n    // ...\n\n    authentication.signOut();\n\n## Thanks\n\nTo build this I made use of the B2C site, the [MSAL library docs](https://github.com/AzureAD/microsoft-authentication-library-for-js), the [react-adal source](https://github.com/salvoravida/react-adal) and this [React MSAL sample](https://github.com/sunilbandla/react-msal-sample). Thanks!\n","readmeFilename":"README.md","gitHead":"f8c305eafae452893765d5f91171f225138fc3ac","_id":"@yoss-org/react-azure-adb2c@0.3.2-lcbeta2","_nodeVersion":"11.6.0","_npmVersion":"6.6.0","dist":{"integrity":"sha512-GrBlvz6W+/KFxtPpL0uVp+eF+6PSCqEwm+tj/wa19Ij2EMLoxKx7oCILfIk7qOTAzYCBrW5SBNI+yngqw3tgoA==","shasum":"43b1b8edfdc3fb5a1a1d1f520d651de00b15115f","tarball":"https://registry.npmjs.org/@yoss-org/react-azure-adb2c/-/react-azure-adb2c-0.3.2-lcbeta2.tgz","fileCount":9,"unpackedSize":173665,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcSLA5CRA9TVsSAnZWagAAX7QP/jdChnYpaxWeqpy42QOs\nj2rXj8IevyjVGkqCudZebov2cW6SUSghttd5wTuWaOf3TPWOdqk0dXaq0jb7\nvt7KsqNheFiUZQG/Bups0X77BZiFADqZIXZfllYP7sW58rE9nl4BaAjmg1vw\nH59GGiHX+GXnnB3SSRPxKmvPO/iU+jIJnADpBeubQ1W/RZ1/45W9s8igLyoH\na/ZW+je8WkrFnk1E4uSk9s9wi6EngNjBvd+K+ykP3qy2/TiVqkrKD0x8Z3gi\nKivuFzDGUSPoPw+ynIeTwdhmvI8HeFRCWUuEN1grnScVb7be2Ydp8JJuVH+r\ncAhifyOMWsF7m4/B+KHp8++lvgsYmy2DXLMA9iMPI+P3meSnt8CDSEhfHVS/\nSNALrCyKVaQ1ydBCwWF3590xwuQLfj+hw3D+cXM/3escpEV1vFswLLJ0xBdS\nl5PDOsBK8NlkUUI/dBLAQSLFpUqZcqAESCYIQPrBncCVVrwg+OVdTLNnnwAs\nsqmIu/u59uzLW+77s3u4F0okINt2FeU0Spx2hSj8Mx+4PjXWVXGWHiORj4uu\now2FrAbI37s/RrvI/nfvDctE5RixUCMxzatbD7HWCWwRaYGqXbtNwpWLYQSn\nQkm3Mj1Mlplg10NPg6O+CXcfu5Qy16YqdK/s9BtSr1BuDeE5AOTYW5nUNf2H\n3sEN\r\n=UsTe\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCrrFNswN5/XBt+THOZCAezpFY3IwZS4MKAslSgT//htAIgSPiQBwXXWgZVcZZssZsHpe6776cHQ7BO2f1erU/xBRc="}]},"maintainers":[{"name":"delwiv","email":"delwiv@gmail.com"},{"name":"fhou","email":"npm@bernardle.com"},{"name":"liryc","email":"cyril@oyst.com"},{"name":"nicolaschenet","email":"ironic51@gmail.com"}],"_npmUser":{"name":"delwiv","email":"delwiv@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/react-azure-adb2c_0.3.2-lcbeta2_1548267576770_0.20438625158397672"},"_hasShrinkwrap":false},"0.3.2-lcbeta3":{"name":"@yoss-org/react-azure-adb2c","version":"0.3.2-lcbeta3","description":"Authentication library for Azure AD B2C and ReactJS","main":"lib/react-azure-adb2c.js","scripts":{"compile":"cross-env NODE_ENV=production babel src --out-dir lib","prepublish":"npm run compile"},"repository":{"type":"git","url":"git+https://github.com/jamesrandall/react-azure-adb2c.git"},"keywords":["react","js","AAD","B2C","oauth","azure"],"author":{"name":"Cyril HAGEGE"},"license":"MIT","bugs":{"url":"https://github.com/JamesRandall/react-azure-adb2c/issues"},"homepage":"https://github.com/JamesRandall/react-azure-adb2c#readme","dependencies":{"msal":"^0.1.5"},"peerDependencies":{"react":"^15.0.0 || ^16.0.0"},"devDependencies":{"babel-cli":"^6.26.0","babel-core":"6.24.1","babel-eslint":"^8.0.3","babel-jest":"20.0.3","babel-loader":"7.0.0","babel-plugin-import":"^1.2.1","babel-polyfill":"^6.23.0","babel-preset-env":"^1.6.1","babel-preset-react-app":"^3.0.0","babel-runtime":"6.23.0","cross-env":"^5.1.4","eslint":"^4.12.1","eslint-config-airbnb":"^16.1.0","eslint-config-defaults":"^9.0.0","eslint-plugin-import":"^2.8.0","eslint-plugin-jsx-a11y":"^6.0.2","eslint-plugin-react":"^7.5.1","eslint-plugin-sort-imports-es6-autofix":"^0.3.0"},"readme":"# README\n\nAzure AD B2C is a cost effective identity provider covering social and enterprise logins but it can be awekward to integrate with - its documentation is currently not great and using it involves rooting around across multiple samples, the ADAL library, and the MSAL library.\n\nThat being the case I've focused this package on B2C although with minor changes it could be used more broadly. MSAL itself, which this library wraps, is rather generic but B2C has some specific requirements and I think half of the problem with the documentation is that you end up drifting across B2C and straight AD. I wanted to make things simpler for B2C.\n\nHopefully this will help people writing React apps. It makes use of MSAL underneath and the core of it (other than protecting routes) will probably work with other frameworks too but I use React at the moment. As it's an SPA my assumption in the library and documentation below is that you ultimately want to get an access token that you can use to call remote APIs. See this [Azure AD B2C post here](https://docs.microsoft.com/en-us/azure/active-directory-b2c/active-directory-b2c-access-tokens) for details on how to set this up on the B2C side.\n\nPRs welcome!\n\n## Installation\n\nIf you are using npm:\n\n    npm install react-azure-adb2c --save\n\nOr if you are using yarn:\n\n    yarn add react-azure-adb2c\n\n## Initializing the Library\n\nYou'll first need to load the module and pass some configuration to the library. Normally this would go in your index.js file:\n\n    import authentication from 'react-azure-adb2c';\n    authentication.initialize({\n        // optional, will default to this\n        instance: 'https://login.microsoftonline.com/tfp/', \n        // your B2C tenant\n        tenant: 'myb2ctenant.onmicrosoft.com',\n        // the policy to use to sign in, can also be a sign up or sign in policy\n        signInPolicy: 'mysigninpolicy',\n        // the policy to use for password reset\n        resetPolicy: 'mypasswordresetpolicy',\n        // the the B2C application you want to authenticate with (that's just a random GUID - get yours from the portal)\n        applicationId: '75ee2b43-ad2c-4366-9b8f-84b7d19d776e',\n        // where MSAL will store state - localStorage or sessionStorage\n        cacheLocation: 'sessionStorage',\n        // the scopes you want included in the access token\n        scopes: ['https://myb2ctenant.onmicrosoft.com/management/admin'],\n        // optional, the redirect URI - if not specified MSAL will pick up the location from window.href\n        redirectUri: 'http://localhost:3000',\n        // optional, the URI to redirect to after logout\n        postLogoutRedirectUri: 'http://myapp.com'\n    });\n    \n## Authenticating When The App Starts\n\nIf you want to set things up so that a user is authenticated as soon as they hit your app (for example if you've got a link to an app from a landing page) then, in index.js, wrap the lines of code that launch the React app with the _authentication.run_ function:\n\n    authentication.run(() => {\n      ReactDOM.render(<App />, document.getElementById('root'));\n      registerServiceWorker();  \n    });\n\n## Triggering Authentication Based on Components Mounting (and routing)\n\nIf you want to set things up so that a user is authenticated as they visit a part of the application that requires authentication then the appropriate components can be wrapped inside higher order components that will handle the authentication process. This is done using the _authentication.required_ function, normally in conjunction with a router. The example below shows this using the popular react-router:\n\n    import React, { Component } from 'react';\n    import authentication from 'react-azure-adb2c'\n    import { BrowserRouter as Router, Route, Switch } from \"react-router-dom\";\n    import HomePage from './Homepage'\n    import MembersArea from './MembersArea'\n    \n    class App extends Component {\n      render() {\n        return (\n          <Router basename={process.env.PUBLIC_URL}>\n            <Switch>\n              <Route exact path=\"/\" component={HomePage} />\n              <Route exact path=\"/membersArea\" component={authentication.required(MembersArea)}>\n            </Switch>\n          </Router>\n        );\n      }\n    }\n\n## Getting the Access Token\n\nSimply call the method _getAccessToken_:\n\n    import authentication from 'react-azure-adb2c'\n\n    // ...\n\n    const token = authentication.getAccessToken();\n\n## Signing Out\n\nTo sign out:\n\n    import authentication from 'react-azure-adb2c'\n\n    // ...\n\n    authentication.signOut();\n\n## Thanks\n\nTo build this I made use of the B2C site, the [MSAL library docs](https://github.com/AzureAD/microsoft-authentication-library-for-js), the [react-adal source](https://github.com/salvoravida/react-adal) and this [React MSAL sample](https://github.com/sunilbandla/react-msal-sample). Thanks!\n","readmeFilename":"README.md","gitHead":"f8c305eafae452893765d5f91171f225138fc3ac","_id":"@yoss-org/react-azure-adb2c@0.3.2-lcbeta3","_nodeVersion":"11.6.0","_npmVersion":"6.6.0","dist":{"integrity":"sha512-yTqZQPhwlJqk3Imf1Li6bfch505f47b3+PcG7RPcWgqhlbdtsbzx2x2h+HbtR9LLXlcjDyoaa/Myg9ymv049zg==","shasum":"211291ddbf77f7057102ed61686144e4212acd4f","tarball":"https://registry.npmjs.org/@yoss-org/react-azure-adb2c/-/react-azure-adb2c-0.3.2-lcbeta3.tgz","fileCount":9,"unpackedSize":173665,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcSLBXCRA9TVsSAnZWagAA8UQP/2FuuKTxk2cp6wvlVczL\nD5GNUoLikMC4Zqc32cCgJG6EZjlpgo+cK4QUxwZps82Vderf+REhL84Zm9TW\nnDBo7iTVHP+qkd0FH3sv4j/YpZTCp9RE6/9Ts8p/+ksFXPmndFKLuXNOCVy3\nSxeG2aBPj0E70299O+L0shirZWghu8JzFP/aKMhUbrMTbPepqrTypAqhYIYe\nd6LcerP0bO44luKhcHPNGw+fmw63op3G2NfevhXVvItFlrxi3RYDzQHxn0Pt\nh++vjCwLsoq81MxG5s5EfKD4pkbBwSCLn4Q6A4SY9jbf5e6Zv/lF8qq3pNKJ\nzEtVCrC1/ARYqZk+K3gEhXHBBZfMzsBuYHt/WRKk8rJT0J5XkMPaJ5Bt6WjY\nlRNfT3K0aYtJBngbU7SdiUUjEnmP/VarYgGtJ0QkpoAuF+vX6H7GUCobNv27\nhigi33j4E6vBMkqKnCwglYuVaXspQ6pmKCQgyeknS9dReGzvzxq21zDBc8+8\nAcw883rMa0WwvAHZ5iC0FhD95sD2rzFv8SRRe6d9qQ/bw8Yj5mJCKJ9yxvb7\nhipOzprGlB+xlNKBY+BLeu7ZeHN3Ia4GTgs4EPCXkEtXYZch5OxUQtx8uHqE\n3lwpWNq4DuYYFPmUDDY7DEeAUWDbPdKxFO6v43xdyFuwRrtLAv1lSE4uwgo/\nui2F\r\n=yAWr\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIB7umCLXhMmvH3ghId1PVKlMiE0Kv9/+P0NsS0jeGcc/AiB8VINXDP61SR2ECbE7ryJt/JDNYzleas4/pSs7vggI9g=="}]},"maintainers":[{"name":"delwiv","email":"delwiv@gmail.com"},{"name":"fhou","email":"npm@bernardle.com"},{"name":"liryc","email":"cyril@oyst.com"},{"name":"nicolaschenet","email":"ironic51@gmail.com"}],"_npmUser":{"name":"delwiv","email":"delwiv@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/react-azure-adb2c_0.3.2-lcbeta3_1548267607247_0.6409384543542389"},"_hasShrinkwrap":false},"0.3.2-lcbeta4":{"name":"@yoss-org/react-azure-adb2c","version":"0.3.2-lcbeta4","description":"Authentication library for Azure AD B2C and ReactJS","main":"lib/react-azure-adb2c.js","scripts":{"compile":"cross-env NODE_ENV=production babel src --out-dir lib","prepublish":"npm run compile"},"repository":{"type":"git","url":"git+https://github.com/jamesrandall/react-azure-adb2c.git"},"keywords":["react","js","AAD","B2C","oauth","azure"],"author":{"name":"Cyril HAGEGE"},"license":"MIT","bugs":{"url":"https://github.com/JamesRandall/react-azure-adb2c/issues"},"homepage":"https://github.com/JamesRandall/react-azure-adb2c#readme","dependencies":{"msal":"^0.1.5"},"peerDependencies":{"react":"^15.0.0 || ^16.0.0"},"devDependencies":{"babel-cli":"^6.26.0","babel-core":"6.24.1","babel-eslint":"^8.0.3","babel-jest":"20.0.3","babel-loader":"7.0.0","babel-plugin-import":"^1.2.1","babel-polyfill":"^6.23.0","babel-preset-env":"^1.6.1","babel-preset-react-app":"^3.0.0","babel-runtime":"6.23.0","cross-env":"^5.1.4","eslint":"^4.12.1","eslint-config-airbnb":"^16.1.0","eslint-config-defaults":"^9.0.0","eslint-plugin-import":"^2.8.0","eslint-plugin-jsx-a11y":"^6.0.2","eslint-plugin-react":"^7.5.1","eslint-plugin-sort-imports-es6-autofix":"^0.3.0"},"readme":"# README\n\nAzure AD B2C is a cost effective identity provider covering social and enterprise logins but it can be awekward to integrate with - its documentation is currently not great and using it involves rooting around across multiple samples, the ADAL library, and the MSAL library.\n\nThat being the case I've focused this package on B2C although with minor changes it could be used more broadly. MSAL itself, which this library wraps, is rather generic but B2C has some specific requirements and I think half of the problem with the documentation is that you end up drifting across B2C and straight AD. I wanted to make things simpler for B2C.\n\nHopefully this will help people writing React apps. It makes use of MSAL underneath and the core of it (other than protecting routes) will probably work with other frameworks too but I use React at the moment. As it's an SPA my assumption in the library and documentation below is that you ultimately want to get an access token that you can use to call remote APIs. See this [Azure AD B2C post here](https://docs.microsoft.com/en-us/azure/active-directory-b2c/active-directory-b2c-access-tokens) for details on how to set this up on the B2C side.\n\nPRs welcome!\n\n## Installation\n\nIf you are using npm:\n\n    npm install react-azure-adb2c --save\n\nOr if you are using yarn:\n\n    yarn add react-azure-adb2c\n\n## Initializing the Library\n\nYou'll first need to load the module and pass some configuration to the library. Normally this would go in your index.js file:\n\n    import authentication from 'react-azure-adb2c';\n    authentication.initialize({\n        // optional, will default to this\n        instance: 'https://login.microsoftonline.com/tfp/', \n        // your B2C tenant\n        tenant: 'myb2ctenant.onmicrosoft.com',\n        // the policy to use to sign in, can also be a sign up or sign in policy\n        signInPolicy: 'mysigninpolicy',\n        // the policy to use for password reset\n        resetPolicy: 'mypasswordresetpolicy',\n        // the the B2C application you want to authenticate with (that's just a random GUID - get yours from the portal)\n        applicationId: '75ee2b43-ad2c-4366-9b8f-84b7d19d776e',\n        // where MSAL will store state - localStorage or sessionStorage\n        cacheLocation: 'sessionStorage',\n        // the scopes you want included in the access token\n        scopes: ['https://myb2ctenant.onmicrosoft.com/management/admin'],\n        // optional, the redirect URI - if not specified MSAL will pick up the location from window.href\n        redirectUri: 'http://localhost:3000',\n        // optional, the URI to redirect to after logout\n        postLogoutRedirectUri: 'http://myapp.com'\n    });\n    \n## Authenticating When The App Starts\n\nIf you want to set things up so that a user is authenticated as soon as they hit your app (for example if you've got a link to an app from a landing page) then, in index.js, wrap the lines of code that launch the React app with the _authentication.run_ function:\n\n    authentication.run(() => {\n      ReactDOM.render(<App />, document.getElementById('root'));\n      registerServiceWorker();  \n    });\n\n## Triggering Authentication Based on Components Mounting (and routing)\n\nIf you want to set things up so that a user is authenticated as they visit a part of the application that requires authentication then the appropriate components can be wrapped inside higher order components that will handle the authentication process. This is done using the _authentication.required_ function, normally in conjunction with a router. The example below shows this using the popular react-router:\n\n    import React, { Component } from 'react';\n    import authentication from 'react-azure-adb2c'\n    import { BrowserRouter as Router, Route, Switch } from \"react-router-dom\";\n    import HomePage from './Homepage'\n    import MembersArea from './MembersArea'\n    \n    class App extends Component {\n      render() {\n        return (\n          <Router basename={process.env.PUBLIC_URL}>\n            <Switch>\n              <Route exact path=\"/\" component={HomePage} />\n              <Route exact path=\"/membersArea\" component={authentication.required(MembersArea)}>\n            </Switch>\n          </Router>\n        );\n      }\n    }\n\n## Getting the Access Token\n\nSimply call the method _getAccessToken_:\n\n    import authentication from 'react-azure-adb2c'\n\n    // ...\n\n    const token = authentication.getAccessToken();\n\n## Signing Out\n\nTo sign out:\n\n    import authentication from 'react-azure-adb2c'\n\n    // ...\n\n    authentication.signOut();\n\n## Thanks\n\nTo build this I made use of the B2C site, the [MSAL library docs](https://github.com/AzureAD/microsoft-authentication-library-for-js), the [react-adal source](https://github.com/salvoravida/react-adal) and this [React MSAL sample](https://github.com/sunilbandla/react-msal-sample). Thanks!\n","readmeFilename":"README.md","gitHead":"f8c305eafae452893765d5f91171f225138fc3ac","_id":"@yoss-org/react-azure-adb2c@0.3.2-lcbeta4","_nodeVersion":"11.6.0","_npmVersion":"6.6.0","dist":{"integrity":"sha512-zuGOeBNZoccShV0P4rCr4WXGwHhPscMmR4QueQGXJdv1CBAWw1YDErSJNgZiENHR/Kde5J2l4rsbNAKNfzSbjA==","shasum":"9a28e67ae36662e3d6c1ce4cf9d019a3f322bf5d","tarball":"https://registry.npmjs.org/@yoss-org/react-azure-adb2c/-/react-azure-adb2c-0.3.2-lcbeta4.tgz","fileCount":9,"unpackedSize":178385,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcSfgWCRA9TVsSAnZWagAAU30P/1c12BzVPHO2PNSJD6t/\niiiDPAAX2UDIfPulmapwK5r/XycfoSqFMPDZWyCcv4mvwPDHSm7CKExNAm5S\nkygS70vhdH0l6GfaBtv+//A7icT7kHoKAn5IoHbSbpXCU3ofY0FtqL48wmko\n34ojmw5yjcmsC1F8t1LzP0RzBCDmAYymkvAJKxizce5Ow2Uf6vlKURE22vNe\nOSSQ18zYEf0G7ww/mAHnKoLkhO2aMey8UXu1XH5sMsGL/rVmxXgsFFHTKhdY\nSLd2porXBhmuNgS5L9PjHlIquMnCHSvGbrVa/hJasDkIX7fPt2YRoZyqEDx6\nvEMLSnGPMCws0sUK1L/fsW1pIKbUzg7PR/KSc/4SStIFtUre1jEo1zDOXA+w\nSiygr6QPyZoK8o9p7qnghV0eZOY9j7YlGpMaYRDkOVszM+ffXYJ6oXT9lD4n\neyE7r5RI1jxKSvbJz+77a7UooLods7n6ZJhp+80t+MceuWqd2GD5XvWXWCoQ\nDKlUvzfbSVIjblFIAA+AJRURZRHumq93oGk8RgDVCwS+hTW50IQCLQpjZfEB\nwn7wyoZtNAN5IsyoGrgqag25eP1EGFsXXinEkgF6INWxstFMdd2HtRZryMC1\n9HnYOgDyd4DIvJlKSVkMkRWBYXkSxHZHo9xN/GqZcS5P8k9wJ6JWwI3kudIy\nKKj+\r\n=PEjw\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDeJKpYa09qtbOAoI6mADBPrp6FFhY5ZE3Dxw6o5qE7iwIhAMDGU67VCmTL9hnwX6Y+dZwyQDRALozZIl/vNIrq0RvK"}]},"maintainers":[{"name":"delwiv","email":"delwiv@gmail.com"},{"name":"fhou","email":"npm@bernardle.com"},{"name":"liryc","email":"cyril@oyst.com"},{"name":"nicolaschenet","email":"ironic51@gmail.com"}],"_npmUser":{"name":"delwiv","email":"delwiv@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/react-azure-adb2c_0.3.2-lcbeta4_1548351510157_0.39433830534734193"},"_hasShrinkwrap":false},"0.3.2-lcbeta5":{"name":"@yoss-org/react-azure-adb2c","version":"0.3.2-lcbeta5","description":"Authentication library for Azure AD B2C and ReactJS","main":"lib/react-azure-adb2c.js","scripts":{"compile":"cross-env NODE_ENV=production babel src --out-dir lib","prepublish":"npm run compile"},"repository":{"type":"git","url":"git+https://github.com/jamesrandall/react-azure-adb2c.git"},"keywords":["react","js","AAD","B2C","oauth","azure"],"author":{"name":"Cyril HAGEGE"},"license":"MIT","bugs":{"url":"https://github.com/JamesRandall/react-azure-adb2c/issues"},"homepage":"https://github.com/JamesRandall/react-azure-adb2c#readme","dependencies":{"msal":"^0.1.5"},"peerDependencies":{"react":"^15.0.0 || ^16.0.0"},"devDependencies":{"babel-cli":"^6.26.0","babel-core":"6.24.1","babel-eslint":"^8.0.3","babel-jest":"20.0.3","babel-loader":"7.0.0","babel-plugin-import":"^1.2.1","babel-polyfill":"^6.23.0","babel-preset-env":"^1.6.1","babel-preset-react-app":"^3.0.0","babel-runtime":"6.23.0","cross-env":"^5.1.4","eslint":"^4.12.1","eslint-config-airbnb":"^16.1.0","eslint-config-defaults":"^9.0.0","eslint-plugin-import":"^2.8.0","eslint-plugin-jsx-a11y":"^6.0.2","eslint-plugin-react":"^7.5.1","eslint-plugin-sort-imports-es6-autofix":"^0.3.0"},"readme":"# README\n\nAzure AD B2C is a cost effective identity provider covering social and enterprise logins but it can be awekward to integrate with - its documentation is currently not great and using it involves rooting around across multiple samples, the ADAL library, and the MSAL library.\n\nThat being the case I've focused this package on B2C although with minor changes it could be used more broadly. MSAL itself, which this library wraps, is rather generic but B2C has some specific requirements and I think half of the problem with the documentation is that you end up drifting across B2C and straight AD. I wanted to make things simpler for B2C.\n\nHopefully this will help people writing React apps. It makes use of MSAL underneath and the core of it (other than protecting routes) will probably work with other frameworks too but I use React at the moment. As it's an SPA my assumption in the library and documentation below is that you ultimately want to get an access token that you can use to call remote APIs. See this [Azure AD B2C post here](https://docs.microsoft.com/en-us/azure/active-directory-b2c/active-directory-b2c-access-tokens) for details on how to set this up on the B2C side.\n\nPRs welcome!\n\n## Installation\n\nIf you are using npm:\n\n    npm install react-azure-adb2c --save\n\nOr if you are using yarn:\n\n    yarn add react-azure-adb2c\n\n## Initializing the Library\n\nYou'll first need to load the module and pass some configuration to the library. Normally this would go in your index.js file:\n\n    import authentication from 'react-azure-adb2c';\n    authentication.initialize({\n        // optional, will default to this\n        instance: 'https://login.microsoftonline.com/tfp/', \n        // your B2C tenant\n        tenant: 'myb2ctenant.onmicrosoft.com',\n        // the policy to use to sign in, can also be a sign up or sign in policy\n        signInPolicy: 'mysigninpolicy',\n        // the policy to use for password reset\n        resetPolicy: 'mypasswordresetpolicy',\n        // the the B2C application you want to authenticate with (that's just a random GUID - get yours from the portal)\n        applicationId: '75ee2b43-ad2c-4366-9b8f-84b7d19d776e',\n        // where MSAL will store state - localStorage or sessionStorage\n        cacheLocation: 'sessionStorage',\n        // the scopes you want included in the access token\n        scopes: ['https://myb2ctenant.onmicrosoft.com/management/admin'],\n        // optional, the redirect URI - if not specified MSAL will pick up the location from window.href\n        redirectUri: 'http://localhost:3000',\n        // optional, the URI to redirect to after logout\n        postLogoutRedirectUri: 'http://myapp.com'\n    });\n    \n## Authenticating When The App Starts\n\nIf you want to set things up so that a user is authenticated as soon as they hit your app (for example if you've got a link to an app from a landing page) then, in index.js, wrap the lines of code that launch the React app with the _authentication.run_ function:\n\n    authentication.run(() => {\n      ReactDOM.render(<App />, document.getElementById('root'));\n      registerServiceWorker();  \n    });\n\n## Triggering Authentication Based on Components Mounting (and routing)\n\nIf you want to set things up so that a user is authenticated as they visit a part of the application that requires authentication then the appropriate components can be wrapped inside higher order components that will handle the authentication process. This is done using the _authentication.required_ function, normally in conjunction with a router. The example below shows this using the popular react-router:\n\n    import React, { Component } from 'react';\n    import authentication from 'react-azure-adb2c'\n    import { BrowserRouter as Router, Route, Switch } from \"react-router-dom\";\n    import HomePage from './Homepage'\n    import MembersArea from './MembersArea'\n    \n    class App extends Component {\n      render() {\n        return (\n          <Router basename={process.env.PUBLIC_URL}>\n            <Switch>\n              <Route exact path=\"/\" component={HomePage} />\n              <Route exact path=\"/membersArea\" component={authentication.required(MembersArea)}>\n            </Switch>\n          </Router>\n        );\n      }\n    }\n\n## Getting the Access Token\n\nSimply call the method _getAccessToken_:\n\n    import authentication from 'react-azure-adb2c'\n\n    // ...\n\n    const token = authentication.getAccessToken();\n\n## Signing Out\n\nTo sign out:\n\n    import authentication from 'react-azure-adb2c'\n\n    // ...\n\n    authentication.signOut();\n\n## Thanks\n\nTo build this I made use of the B2C site, the [MSAL library docs](https://github.com/AzureAD/microsoft-authentication-library-for-js), the [react-adal source](https://github.com/salvoravida/react-adal) and this [React MSAL sample](https://github.com/sunilbandla/react-msal-sample). Thanks!\n","readmeFilename":"README.md","gitHead":"f8c305eafae452893765d5f91171f225138fc3ac","_id":"@yoss-org/react-azure-adb2c@0.3.2-lcbeta5","_nodeVersion":"11.6.0","_npmVersion":"6.6.0","dist":{"integrity":"sha512-3EfpJPvcTaxgJe6ncyivmrNN3Vm9srD7aBRwtyB/9vHjo9Tlz4sUVy/hzTFI62zI6s8YJ+G4GKqzG/ui6Keq2g==","shasum":"dc7f2347ec84f72135cccb624d5ff545fe9c026e","tarball":"https://registry.npmjs.org/@yoss-org/react-azure-adb2c/-/react-azure-adb2c-0.3.2-lcbeta5.tgz","fileCount":9,"unpackedSize":177727,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcSgYgCRA9TVsSAnZWagAAtFoP/R4Yd++ikqu0a9nZR5wh\nYUQpE7zyjmgf6opOeUCxG9cfBhQcHry5ZVo4nEI6NCOgkIoZNsslKx+tpJ3Q\nin2jzV86+2YWmS7fCov574ssNOzygXxZ45lY6j5bbGnWuheEfb1sj7VK/wUx\nHaPJC2Y2KRPRQaYzyMcJg/l0cqoVUbdH9+ukd0uXHtNL0g6KO+VcfI88SCD/\npt4YZHVIdS7Y5lPd0yxkV29RYJbjYG+FVp2/NxWpOy8YjuJ/iRWDp+FxAhfU\nSIriNgH5cqKKK1vmR39raEcwIIO47lhxSLXtqVW7UQhqqOz8XjPvuiuE8x1X\nJ1iFiwbVEfuHUPCBudBzWJ44YGqSpG2AriH29f417Xuw0NSUDpt2IZFox1dB\n8Nfd6CHiYgtynpTWzDueEIDuFnKI3/kHwG4j7Jed46j2OMqZBCVXfTplL6Et\nHjMPQxMVmeca5r6zUuqy0RCf3Dg+3/58KrvFXxiI2Ch6IK8XfnXwB2K4PhaO\nVYtrWS78oJLVS2+PHARQgstrRq8CLCnoxb08OPE5lIYmDLRE4hGI6M5rA+xQ\nCXC+odwq0sVCLVlNM8IEDqqIoJ8XOHgfXfokR/lQjJNVfOlaUH3GEue5For1\ntT3rLCTSdd5TQ2tpatAcMph1aFUHuvvxNZM+z0I3034MC2LHVwVqyEFJtd6k\nhNts\r\n=yKR9\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDecwYZmLbwha2Ozkw3kV3482toD3oPMz8z01WB6XC9awIhANjezYN6ourOdSU92D7lIu5sekFxTSTXGw7vz252F6ga"}]},"maintainers":[{"name":"delwiv","email":"delwiv@gmail.com"},{"name":"fhou","email":"npm@bernardle.com"},{"name":"liryc","email":"cyril@oyst.com"},{"name":"nicolaschenet","email":"ironic51@gmail.com"}],"_npmUser":{"name":"delwiv","email":"delwiv@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/react-azure-adb2c_0.3.2-lcbeta5_1548355104346_0.664017721629172"},"_hasShrinkwrap":false},"0.3.2-lcbeta6":{"name":"@yoss-org/react-azure-adb2c","version":"0.3.2-lcbeta6","description":"Authentication library for Azure AD B2C and ReactJS","main":"lib/react-azure-adb2c.js","scripts":{"compile":"cross-env NODE_ENV=production babel src --out-dir lib","prepublish":"npm run compile"},"repository":{"type":"git","url":"git+https://github.com/jamesrandall/react-azure-adb2c.git"},"keywords":["react","js","AAD","B2C","oauth","azure"],"author":{"name":"Cyril HAGEGE"},"license":"MIT","bugs":{"url":"https://github.com/JamesRandall/react-azure-adb2c/issues"},"homepage":"https://github.com/JamesRandall/react-azure-adb2c#readme","dependencies":{"msal":"^0.1.5"},"peerDependencies":{"react":"^15.0.0 || ^16.0.0"},"devDependencies":{"babel-cli":"^6.26.0","babel-core":"6.24.1","babel-eslint":"^8.0.3","babel-jest":"20.0.3","babel-loader":"7.0.0","babel-plugin-import":"^1.2.1","babel-polyfill":"^6.23.0","babel-preset-env":"^1.6.1","babel-preset-react-app":"^3.0.0","babel-runtime":"6.23.0","cross-env":"^5.1.4","eslint":"^4.12.1","eslint-config-airbnb":"^16.1.0","eslint-config-defaults":"^9.0.0","eslint-plugin-import":"^2.8.0","eslint-plugin-jsx-a11y":"^6.0.2","eslint-plugin-react":"^7.5.1","eslint-plugin-sort-imports-es6-autofix":"^0.3.0"},"readme":"# README\n\nAzure AD B2C is a cost effective identity provider covering social and enterprise logins but it can be awekward to integrate with - its documentation is currently not great and using it involves rooting around across multiple samples, the ADAL library, and the MSAL library.\n\nThat being the case I've focused this package on B2C although with minor changes it could be used more broadly. MSAL itself, which this library wraps, is rather generic but B2C has some specific requirements and I think half of the problem with the documentation is that you end up drifting across B2C and straight AD. I wanted to make things simpler for B2C.\n\nHopefully this will help people writing React apps. It makes use of MSAL underneath and the core of it (other than protecting routes) will probably work with other frameworks too but I use React at the moment. As it's an SPA my assumption in the library and documentation below is that you ultimately want to get an access token that you can use to call remote APIs. See this [Azure AD B2C post here](https://docs.microsoft.com/en-us/azure/active-directory-b2c/active-directory-b2c-access-tokens) for details on how to set this up on the B2C side.\n\nPRs welcome!\n\n## Installation\n\nIf you are using npm:\n\n    npm install react-azure-adb2c --save\n\nOr if you are using yarn:\n\n    yarn add react-azure-adb2c\n\n## Initializing the Library\n\nYou'll first need to load the module and pass some configuration to the library. Normally this would go in your index.js file:\n\n    import authentication from 'react-azure-adb2c';\n    authentication.initialize({\n        // optional, will default to this\n        instance: 'https://login.microsoftonline.com/tfp/', \n        // your B2C tenant\n        tenant: 'myb2ctenant.onmicrosoft.com',\n        // the policy to use to sign in, can also be a sign up or sign in policy\n        signInPolicy: 'mysigninpolicy',\n        // the policy to use for password reset\n        resetPolicy: 'mypasswordresetpolicy',\n        // the the B2C application you want to authenticate with (that's just a random GUID - get yours from the portal)\n        applicationId: '75ee2b43-ad2c-4366-9b8f-84b7d19d776e',\n        // where MSAL will store state - localStorage or sessionStorage\n        cacheLocation: 'sessionStorage',\n        // the scopes you want included in the access token\n        scopes: ['https://myb2ctenant.onmicrosoft.com/management/admin'],\n        // optional, the redirect URI - if not specified MSAL will pick up the location from window.href\n        redirectUri: 'http://localhost:3000',\n        // optional, the URI to redirect to after logout\n        postLogoutRedirectUri: 'http://myapp.com'\n    });\n    \n## Authenticating When The App Starts\n\nIf you want to set things up so that a user is authenticated as soon as they hit your app (for example if you've got a link to an app from a landing page) then, in index.js, wrap the lines of code that launch the React app with the _authentication.run_ function:\n\n    authentication.run(() => {\n      ReactDOM.render(<App />, document.getElementById('root'));\n      registerServiceWorker();  \n    });\n\n## Triggering Authentication Based on Components Mounting (and routing)\n\nIf you want to set things up so that a user is authenticated as they visit a part of the application that requires authentication then the appropriate components can be wrapped inside higher order components that will handle the authentication process. This is done using the _authentication.required_ function, normally in conjunction with a router. The example below shows this using the popular react-router:\n\n    import React, { Component } from 'react';\n    import authentication from 'react-azure-adb2c'\n    import { BrowserRouter as Router, Route, Switch } from \"react-router-dom\";\n    import HomePage from './Homepage'\n    import MembersArea from './MembersArea'\n    \n    class App extends Component {\n      render() {\n        return (\n          <Router basename={process.env.PUBLIC_URL}>\n            <Switch>\n              <Route exact path=\"/\" component={HomePage} />\n              <Route exact path=\"/membersArea\" component={authentication.required(MembersArea)}>\n            </Switch>\n          </Router>\n        );\n      }\n    }\n\n## Getting the Access Token\n\nSimply call the method _getAccessToken_:\n\n    import authentication from 'react-azure-adb2c'\n\n    // ...\n\n    const token = authentication.getAccessToken();\n\n## Signing Out\n\nTo sign out:\n\n    import authentication from 'react-azure-adb2c'\n\n    // ...\n\n    authentication.signOut();\n\n## Thanks\n\nTo build this I made use of the B2C site, the [MSAL library docs](https://github.com/AzureAD/microsoft-authentication-library-for-js), the [react-adal source](https://github.com/salvoravida/react-adal) and this [React MSAL sample](https://github.com/sunilbandla/react-msal-sample). Thanks!\n","readmeFilename":"README.md","gitHead":"f8c305eafae452893765d5f91171f225138fc3ac","_id":"@yoss-org/react-azure-adb2c@0.3.2-lcbeta6","_nodeVersion":"11.6.0","_npmVersion":"6.6.0","dist":{"integrity":"sha512-Ptxt/uX3qTgBFEIshWlgEdBN7VVBHWaWhbvIYt/DxX48YiqP32Y7l6n+aC5O3Uexc+iAg6lGrbM6GqpBeeEfTA==","shasum":"2b22e72e6a5f89cf4902bedb2d413f0b3d257148","tarball":"https://registry.npmjs.org/@yoss-org/react-azure-adb2c/-/react-azure-adb2c-0.3.2-lcbeta6.tgz","fileCount":9,"unpackedSize":177649,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcSgufCRA9TVsSAnZWagAAzXsP/iA3fJ5qSSCaU+v6lu9V\n05lHkj6SRvQVUwRA6pgMu5ON8JhRQAqNVP0z6HHmkWCaW23rJ/yoIr+Mpadp\nuGw2Lklja0JiyLrQkwQHp2yfLI8TRklJq/+ypvOapjY731T5d/G3pZUkU0wZ\nBodBNyXqdM34paMbNFynu/Jayv1vsf18L1iGURXt0o7h6mTcVcJ1iW2Hzebu\neEhzPAFt90AkFco7gb5Xt3j7XVJNDtRzxjvbrBDdwwQebDslNUsSsBqyR/jT\n3vaYJ+fhJtZ/jRrZo08nF6CS36HNlXb+ddND6cIlS/2DMsu4W4tlJdecMTeA\nN29dmCm3F56Y+MDhsqtSIOD2uTFVguZ4H6D5RYgCA6NlikxH4R+K109sz7N2\nn0AEO1bXvYmRM82L94KFmmglxIcem9lfRk//xdYzdurTZ62/OotaFbT6pIM5\nsBJM2/Gc2BNOj/UIKtoqrGsvAnWtPw2WrG3hujcUPNkth4+2Irt6nlcDJEe3\n/rsa1DhES8JZfzxJRhfuLvzDDdvHsegdc1/yQ3+k7NdLBrl9UBEMV3dXFLiD\nJOnEXCKWGaOrqTqdjtpfDPpKuZwqEHqAMpqtziLQn4Lj2e4TCaMcx6at/jB5\nScu0dsQWnYpuUG2Kmju/4+a+SIUECiHChwTkDs6LZ9JaNXQDttn4Wu8c/yQN\nLW7a\r\n=XT4o\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIG/OS0YDVvU2/5yVl+OySlN5qXL1x9fU2gvxjI8HLjWlAiEA+WM1R4m1iP7fHLolLmBY/97FcY0DyS0y+CeiN2Vmgcc="}]},"maintainers":[{"name":"delwiv","email":"delwiv@gmail.com"},{"name":"fhou","email":"npm@bernardle.com"},{"name":"liryc","email":"cyril@oyst.com"},{"name":"nicolaschenet","email":"ironic51@gmail.com"}],"_npmUser":{"name":"delwiv","email":"delwiv@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/react-azure-adb2c_0.3.2-lcbeta6_1548356511228_0.6482345041929154"},"_hasShrinkwrap":false},"0.3.2-lcbeta7":{"name":"@yoss-org/react-azure-adb2c","version":"0.3.2-lcbeta7","description":"Authentication library for Azure AD B2C and ReactJS","main":"lib/react-azure-adb2c.js","scripts":{"compile":"cross-env NODE_ENV=production babel src --out-dir lib","prepublish":"npm run compile"},"repository":{"type":"git","url":"git+https://github.com/jamesrandall/react-azure-adb2c.git"},"keywords":["react","js","AAD","B2C","oauth","azure"],"author":{"name":"Cyril HAGEGE"},"license":"MIT","bugs":{"url":"https://github.com/JamesRandall/react-azure-adb2c/issues"},"homepage":"https://github.com/JamesRandall/react-azure-adb2c#readme","dependencies":{"msal":"^0.1.5"},"peerDependencies":{"react":"^15.0.0 || ^16.0.0"},"devDependencies":{"babel-cli":"^6.26.0","babel-core":"6.24.1","babel-eslint":"^8.0.3","babel-jest":"20.0.3","babel-loader":"7.0.0","babel-plugin-import":"^1.2.1","babel-polyfill":"^6.23.0","babel-preset-env":"^1.6.1","babel-preset-react-app":"^3.0.0","babel-runtime":"6.23.0","cross-env":"^5.1.4","eslint":"^4.12.1","eslint-config-airbnb":"^16.1.0","eslint-config-defaults":"^9.0.0","eslint-plugin-import":"^2.8.0","eslint-plugin-jsx-a11y":"^6.0.2","eslint-plugin-react":"^7.5.1","eslint-plugin-sort-imports-es6-autofix":"^0.3.0"},"readme":"# README\n\nAzure AD B2C is a cost effective identity provider covering social and enterprise logins but it can be awekward to integrate with - its documentation is currently not great and using it involves rooting around across multiple samples, the ADAL library, and the MSAL library.\n\nThat being the case I've focused this package on B2C although with minor changes it could be used more broadly. MSAL itself, which this library wraps, is rather generic but B2C has some specific requirements and I think half of the problem with the documentation is that you end up drifting across B2C and straight AD. I wanted to make things simpler for B2C.\n\nHopefully this will help people writing React apps. It makes use of MSAL underneath and the core of it (other than protecting routes) will probably work with other frameworks too but I use React at the moment. As it's an SPA my assumption in the library and documentation below is that you ultimately want to get an access token that you can use to call remote APIs. See this [Azure AD B2C post here](https://docs.microsoft.com/en-us/azure/active-directory-b2c/active-directory-b2c-access-tokens) for details on how to set this up on the B2C side.\n\nPRs welcome!\n\n## Installation\n\nIf you are using npm:\n\n    npm install react-azure-adb2c --save\n\nOr if you are using yarn:\n\n    yarn add react-azure-adb2c\n\n## Initializing the Library\n\nYou'll first need to load the module and pass some configuration to the library. Normally this would go in your index.js file:\n\n    import authentication from 'react-azure-adb2c';\n    authentication.initialize({\n        // optional, will default to this\n        instance: 'https://login.microsoftonline.com/tfp/', \n        // your B2C tenant\n        tenant: 'myb2ctenant.onmicrosoft.com',\n        // the policy to use to sign in, can also be a sign up or sign in policy\n        signInPolicy: 'mysigninpolicy',\n        // the policy to use for password reset\n        resetPolicy: 'mypasswordresetpolicy',\n        // the the B2C application you want to authenticate with (that's just a random GUID - get yours from the portal)\n        applicationId: '75ee2b43-ad2c-4366-9b8f-84b7d19d776e',\n        // where MSAL will store state - localStorage or sessionStorage\n        cacheLocation: 'sessionStorage',\n        // the scopes you want included in the access token\n        scopes: ['https://myb2ctenant.onmicrosoft.com/management/admin'],\n        // optional, the redirect URI - if not specified MSAL will pick up the location from window.href\n        redirectUri: 'http://localhost:3000',\n        // optional, the URI to redirect to after logout\n        postLogoutRedirectUri: 'http://myapp.com'\n    });\n    \n## Authenticating When The App Starts\n\nIf you want to set things up so that a user is authenticated as soon as they hit your app (for example if you've got a link to an app from a landing page) then, in index.js, wrap the lines of code that launch the React app with the _authentication.run_ function:\n\n    authentication.run(() => {\n      ReactDOM.render(<App />, document.getElementById('root'));\n      registerServiceWorker();  \n    });\n\n## Triggering Authentication Based on Components Mounting (and routing)\n\nIf you want to set things up so that a user is authenticated as they visit a part of the application that requires authentication then the appropriate components can be wrapped inside higher order components that will handle the authentication process. This is done using the _authentication.required_ function, normally in conjunction with a router. The example below shows this using the popular react-router:\n\n    import React, { Component } from 'react';\n    import authentication from 'react-azure-adb2c'\n    import { BrowserRouter as Router, Route, Switch } from \"react-router-dom\";\n    import HomePage from './Homepage'\n    import MembersArea from './MembersArea'\n    \n    class App extends Component {\n      render() {\n        return (\n          <Router basename={process.env.PUBLIC_URL}>\n            <Switch>\n              <Route exact path=\"/\" component={HomePage} />\n              <Route exact path=\"/membersArea\" component={authentication.required(MembersArea)}>\n            </Switch>\n          </Router>\n        );\n      }\n    }\n\n## Getting the Access Token\n\nSimply call the method _getAccessToken_:\n\n    import authentication from 'react-azure-adb2c'\n\n    // ...\n\n    const token = authentication.getAccessToken();\n\n## Signing Out\n\nTo sign out:\n\n    import authentication from 'react-azure-adb2c'\n\n    // ...\n\n    authentication.signOut();\n\n## Thanks\n\nTo build this I made use of the B2C site, the [MSAL library docs](https://github.com/AzureAD/microsoft-authentication-library-for-js), the [react-adal source](https://github.com/salvoravida/react-adal) and this [React MSAL sample](https://github.com/sunilbandla/react-msal-sample). Thanks!\n","readmeFilename":"README.md","gitHead":"f8c305eafae452893765d5f91171f225138fc3ac","_id":"@yoss-org/react-azure-adb2c@0.3.2-lcbeta7","_nodeVersion":"11.6.0","_npmVersion":"6.6.0","dist":{"integrity":"sha512-5mTNXiaBihAo44Iv+PrARi85W5ehwj9gQRiU5GygeuDX5P9YADw97qVyD4gDqXWeSL0X+A/CoGLUabClwJJpug==","shasum":"9be820716054e2812388752deb58d88f7c8b75dc","tarball":"https://registry.npmjs.org/@yoss-org/react-azure-adb2c/-/react-azure-adb2c-0.3.2-lcbeta7.tgz","fileCount":9,"unpackedSize":177835,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcShUdCRA9TVsSAnZWagAApXkP/j9SaziWTcj4s8Pun9Vl\nJhH5X4/sKfAL9uvqqMz+RLcwWej0reRI+N+jcS1WCoHEII9ZIDwGLBHLJaFF\n86TfqTMHi73sW0OBNi54OGWcbtqw5FVAYy7xqBpAQWgNWRUyGaTN4TB/K/nU\nXe+mFPLIJGxU6Q5Ci2tXFBgmnMjNtPAja7ulDgv26FR623s2KvtQcmYDWRAj\nVhzUel/jR/VNyjH8lO8hG5Z5QMvUQn+18k6sAMAohSZxLEl1bsnvB4BtY4Ih\ntSjaR4dXEKQQDR3CTuPuyRWI0Yvqyow7HhfSuFvY2yuiqqyL5IU+YTC2I9Sd\nQHghOgcwL6FwfuxziWfCp+xO0tShlTxQXpvd6dWCw8K9uHlHqGaYaTexxYi3\nn6Cc2ROA0dgMoCyPYWVmVSW8xqEN8/H9ovssjG/k+9hlh0tbDx91aBeX63xR\nguXxqakTNSyW+k1kt3fyZYtsSTEEISc5DyqUPaL9f+0+7TkzB/yzvMvZz0H+\nc718t0Bchj09gp2qUI/8kpMUGAVsPxDMGzKhfRwm958Ne5r3sWw77SsjmbIW\n7AI5QXswi8uMNfvb2YGcNTwDxEzbr4FBVnPLN3x48ITKhm1PMQcSfFIyPJ60\nFhUrT39AlK0creCMsuzUyQj4WBlQfLmYtDQKtJsOES3kcEIzk5xuBRMfobn9\nMsyi\r\n=l73d\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCfGSWYr0fIGOSXejz+2hGR5q7o9KrNichkaQVk556YfAIgbujOwMRBd3oLbc32un3s1GuOVBfw+Cd0Q784acprS7M="}]},"maintainers":[{"name":"delwiv","email":"delwiv@gmail.com"},{"name":"fhou","email":"npm@bernardle.com"},{"name":"liryc","email":"cyril@oyst.com"},{"name":"nicolaschenet","email":"ironic51@gmail.com"}],"_npmUser":{"name":"delwiv","email":"delwiv@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/react-azure-adb2c_0.3.2-lcbeta7_1548358941305_0.3736276528758107"},"_hasShrinkwrap":false},"0.3.2-lcbeta8":{"name":"@yoss-org/react-azure-adb2c","version":"0.3.2-lcbeta8","description":"Authentication library for Azure AD B2C and ReactJS","main":"lib/react-azure-adb2c.js","scripts":{"compile":"cross-env NODE_ENV=production babel src --out-dir lib","prepublish":"npm run compile"},"repository":{"type":"git","url":"git+https://github.com/jamesrandall/react-azure-adb2c.git"},"keywords":["react","js","AAD","B2C","oauth","azure"],"author":{"name":"Cyril HAGEGE"},"license":"MIT","bugs":{"url":"https://github.com/JamesRandall/react-azure-adb2c/issues"},"homepage":"https://github.com/JamesRandall/react-azure-adb2c#readme","dependencies":{"msal":"^0.1.5"},"peerDependencies":{"react":"^15.0.0 || ^16.0.0"},"devDependencies":{"babel-cli":"^6.26.0","babel-core":"6.24.1","babel-eslint":"^8.0.3","babel-jest":"20.0.3","babel-loader":"7.0.0","babel-plugin-import":"^1.2.1","babel-polyfill":"^6.23.0","babel-preset-env":"^1.6.1","babel-preset-react-app":"^3.0.0","babel-runtime":"6.23.0","cross-env":"^5.1.4","eslint":"^4.12.1","eslint-config-airbnb":"^16.1.0","eslint-config-defaults":"^9.0.0","eslint-plugin-import":"^2.8.0","eslint-plugin-jsx-a11y":"^6.0.2","eslint-plugin-react":"^7.5.1","eslint-plugin-sort-imports-es6-autofix":"^0.3.0"},"readme":"# README\n\nAzure AD B2C is a cost effective identity provider covering social and enterprise logins but it can be awekward to integrate with - its documentation is currently not great and using it involves rooting around across multiple samples, the ADAL library, and the MSAL library.\n\nThat being the case I've focused this package on B2C although with minor changes it could be used more broadly. MSAL itself, which this library wraps, is rather generic but B2C has some specific requirements and I think half of the problem with the documentation is that you end up drifting across B2C and straight AD. I wanted to make things simpler for B2C.\n\nHopefully this will help people writing React apps. It makes use of MSAL underneath and the core of it (other than protecting routes) will probably work with other frameworks too but I use React at the moment. As it's an SPA my assumption in the library and documentation below is that you ultimately want to get an access token that you can use to call remote APIs. See this [Azure AD B2C post here](https://docs.microsoft.com/en-us/azure/active-directory-b2c/active-directory-b2c-access-tokens) for details on how to set this up on the B2C side.\n\nPRs welcome!\n\n## Installation\n\nIf you are using npm:\n\n    npm install react-azure-adb2c --save\n\nOr if you are using yarn:\n\n    yarn add react-azure-adb2c\n\n## Initializing the Library\n\nYou'll first need to load the module and pass some configuration to the library. Normally this would go in your index.js file:\n\n    import authentication from 'react-azure-adb2c';\n    authentication.initialize({\n        // optional, will default to this\n        instance: 'https://login.microsoftonline.com/tfp/', \n        // your B2C tenant\n        tenant: 'myb2ctenant.onmicrosoft.com',\n        // the policy to use to sign in, can also be a sign up or sign in policy\n        signInPolicy: 'mysigninpolicy',\n        // the policy to use for password reset\n        resetPolicy: 'mypasswordresetpolicy',\n        // the the B2C application you want to authenticate with (that's just a random GUID - get yours from the portal)\n        applicationId: '75ee2b43-ad2c-4366-9b8f-84b7d19d776e',\n        // where MSAL will store state - localStorage or sessionStorage\n        cacheLocation: 'sessionStorage',\n        // the scopes you want included in the access token\n        scopes: ['https://myb2ctenant.onmicrosoft.com/management/admin'],\n        // optional, the redirect URI - if not specified MSAL will pick up the location from window.href\n        redirectUri: 'http://localhost:3000',\n        // optional, the URI to redirect to after logout\n        postLogoutRedirectUri: 'http://myapp.com'\n    });\n    \n## Authenticating When The App Starts\n\nIf you want to set things up so that a user is authenticated as soon as they hit your app (for example if you've got a link to an app from a landing page) then, in index.js, wrap the lines of code that launch the React app with the _authentication.run_ function:\n\n    authentication.run(() => {\n      ReactDOM.render(<App />, document.getElementById('root'));\n      registerServiceWorker();  \n    });\n\n## Triggering Authentication Based on Components Mounting (and routing)\n\nIf you want to set things up so that a user is authenticated as they visit a part of the application that requires authentication then the appropriate components can be wrapped inside higher order components that will handle the authentication process. This is done using the _authentication.required_ function, normally in conjunction with a router. The example below shows this using the popular react-router:\n\n    import React, { Component } from 'react';\n    import authentication from 'react-azure-adb2c'\n    import { BrowserRouter as Router, Route, Switch } from \"react-router-dom\";\n    import HomePage from './Homepage'\n    import MembersArea from './MembersArea'\n    \n    class App extends Component {\n      render() {\n        return (\n          <Router basename={process.env.PUBLIC_URL}>\n            <Switch>\n              <Route exact path=\"/\" component={HomePage} />\n              <Route exact path=\"/membersArea\" component={authentication.required(MembersArea)}>\n            </Switch>\n          </Router>\n        );\n      }\n    }\n\n## Getting the Access Token\n\nSimply call the method _getAccessToken_:\n\n    import authentication from 'react-azure-adb2c'\n\n    // ...\n\n    const token = authentication.getAccessToken();\n\n## Signing Out\n\nTo sign out:\n\n    import authentication from 'react-azure-adb2c'\n\n    // ...\n\n    authentication.signOut();\n\n## Thanks\n\nTo build this I made use of the B2C site, the [MSAL library docs](https://github.com/AzureAD/microsoft-authentication-library-for-js), the [react-adal source](https://github.com/salvoravida/react-adal) and this [React MSAL sample](https://github.com/sunilbandla/react-msal-sample). Thanks!\n","readmeFilename":"README.md","gitHead":"f8c305eafae452893765d5f91171f225138fc3ac","_id":"@yoss-org/react-azure-adb2c@0.3.2-lcbeta8","_nodeVersion":"11.6.0","_npmVersion":"6.6.0","dist":{"integrity":"sha512-jYijFGBsxatVuv4q+5/G5J5zkmWA6fzGml6y7j3gtwhjfTDb+Sjuy7LrskvPVBxYeWuaYUd0AX3koqpv++IRHQ==","shasum":"5bc94f2dd9b870699a3b5fd1c74badff8cdee36f","tarball":"https://registry.npmjs.org/@yoss-org/react-azure-adb2c/-/react-azure-adb2c-0.3.2-lcbeta8.tgz","fileCount":9,"unpackedSize":177866,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcShYeCRA9TVsSAnZWagAALxcP/i1CB3JDZUt2SiweiTNV\nGL1VqTEjtGOzxvsFxK7HR08Vfqxm4OcUNWHmculngjh2+YCNm8H2Z5NGzW1c\njthOZzIt9s6zqzogt3ZKPMQBvQPk3EU8QKmKU2STM1PrjVBTV5PzKtg1iaFJ\ngU6hg+7dU0D3/0++ZAPfa9bjr3qiVTjLRdPTeJgT4giBBdgcFKReZizVo/u6\nRetLkZcd5O97arMRnpCg6Fx06wDsc+4RtkUol7jMFIpPM4edxshQsZpbzRTf\nghsvyTc1PnA2e29RbKsdrlV4wJokfKkw+REzdhBynRPCLNTbbEL3kNBWD7Hw\n3BpBfKuKzRCP3l0xHIgjZASrjwYaLuhNH/HHUbJBdryv0j8WmuLqQB+PeTa6\ny7l/8LFKLVjL2GkkFda4U3iDKvA/N/0vR12JvD9zvsKOoCQHt6XkcS9RUuOs\nd4dwBnXJ1aKDNcn67lhpq5XP8jVygF1nBW4m/UkZKPUzblFFonmrcX2O9LXp\nJT6fE9dmaWDBYm3fSoI7lEpUBr6gxNLbYTYU0kMia4y6vTH46QFkDokcEVtN\n63zuMNdtge1ph50em9kQQQFfXGK4pmhW0Oxz+4O9tX6ZoGldgvvfcstNp7nj\n2+7FluLBTSjjBRyeSaebYSIglI13WVznUV1LIYPnqKlZb4jaq6miYNQntk2N\nWobc\r\n=n2wt\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDtPA9BcOOX0SN1JiDS+MItQFgVOvsfwjOI7AKrZfEF6wIhALQQahEE4MrPZRB0NDCcAgMsnL0qUBhES22g10FK8/1d"}]},"maintainers":[{"name":"delwiv","email":"delwiv@gmail.com"},{"name":"fhou","email":"npm@bernardle.com"},{"name":"liryc","email":"cyril@oyst.com"},{"name":"nicolaschenet","email":"ironic51@gmail.com"}],"_npmUser":{"name":"delwiv","email":"delwiv@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/react-azure-adb2c_0.3.2-lcbeta8_1548359198285_0.5079835162357029"},"_hasShrinkwrap":false},"0.3.2-lcbeta9":{"name":"@yoss-org/react-azure-adb2c","version":"0.3.2-lcbeta9","description":"Authentication library for Azure AD B2C and ReactJS","main":"lib/react-azure-adb2c.js","scripts":{"compile":"cross-env NODE_ENV=production babel src --out-dir lib","prepublish":"npm run compile"},"repository":{"type":"git","url":"git+https://github.com/jamesrandall/react-azure-adb2c.git"},"keywords":["react","js","AAD","B2C","oauth","azure"],"author":{"name":"Cyril HAGEGE"},"license":"MIT","bugs":{"url":"https://github.com/JamesRandall/react-azure-adb2c/issues"},"homepage":"https://github.com/JamesRandall/react-azure-adb2c#readme","dependencies":{"msal":"^0.1.5"},"peerDependencies":{"react":"^15.0.0 || ^16.0.0"},"devDependencies":{"babel-cli":"^6.26.0","babel-core":"6.24.1","babel-eslint":"^8.0.3","babel-jest":"20.0.3","babel-loader":"7.0.0","babel-plugin-import":"^1.2.1","babel-polyfill":"^6.23.0","babel-preset-env":"^1.6.1","babel-preset-react-app":"^3.0.0","babel-runtime":"6.23.0","cross-env":"^5.1.4","eslint":"^4.12.1","eslint-config-airbnb":"^16.1.0","eslint-config-defaults":"^9.0.0","eslint-plugin-import":"^2.8.0","eslint-plugin-jsx-a11y":"^6.0.2","eslint-plugin-react":"^7.5.1","eslint-plugin-sort-imports-es6-autofix":"^0.3.0"},"readme":"# README\n\nAzure AD B2C is a cost effective identity provider covering social and enterprise logins but it can be awekward to integrate with - its documentation is currently not great and using it involves rooting around across multiple samples, the ADAL library, and the MSAL library.\n\nThat being the case I've focused this package on B2C although with minor changes it could be used more broadly. MSAL itself, which this library wraps, is rather generic but B2C has some specific requirements and I think half of the problem with the documentation is that you end up drifting across B2C and straight AD. I wanted to make things simpler for B2C.\n\nHopefully this will help people writing React apps. It makes use of MSAL underneath and the core of it (other than protecting routes) will probably work with other frameworks too but I use React at the moment. As it's an SPA my assumption in the library and documentation below is that you ultimately want to get an access token that you can use to call remote APIs. See this [Azure AD B2C post here](https://docs.microsoft.com/en-us/azure/active-directory-b2c/active-directory-b2c-access-tokens) for details on how to set this up on the B2C side.\n\nPRs welcome!\n\n## Installation\n\nIf you are using npm:\n\n    npm install react-azure-adb2c --save\n\nOr if you are using yarn:\n\n    yarn add react-azure-adb2c\n\n## Initializing the Library\n\nYou'll first need to load the module and pass some configuration to the library. Normally this would go in your index.js file:\n\n    import authentication from 'react-azure-adb2c';\n    authentication.initialize({\n        // optional, will default to this\n        instance: 'https://login.microsoftonline.com/tfp/', \n        // your B2C tenant\n        tenant: 'myb2ctenant.onmicrosoft.com',\n        // the policy to use to sign in, can also be a sign up or sign in policy\n        signInPolicy: 'mysigninpolicy',\n        // the policy to use for password reset\n        resetPolicy: 'mypasswordresetpolicy',\n        // the the B2C application you want to authenticate with (that's just a random GUID - get yours from the portal)\n        applicationId: '75ee2b43-ad2c-4366-9b8f-84b7d19d776e',\n        // where MSAL will store state - localStorage or sessionStorage\n        cacheLocation: 'sessionStorage',\n        // the scopes you want included in the access token\n        scopes: ['https://myb2ctenant.onmicrosoft.com/management/admin'],\n        // optional, the redirect URI - if not specified MSAL will pick up the location from window.href\n        redirectUri: 'http://localhost:3000',\n        // optional, the URI to redirect to after logout\n        postLogoutRedirectUri: 'http://myapp.com'\n    });\n    \n## Authenticating When The App Starts\n\nIf you want to set things up so that a user is authenticated as soon as they hit your app (for example if you've got a link to an app from a landing page) then, in index.js, wrap the lines of code that launch the React app with the _authentication.run_ function:\n\n    authentication.run(() => {\n      ReactDOM.render(<App />, document.getElementById('root'));\n      registerServiceWorker();  \n    });\n\n## Triggering Authentication Based on Components Mounting (and routing)\n\nIf you want to set things up so that a user is authenticated as they visit a part of the application that requires authentication then the appropriate components can be wrapped inside higher order components that will handle the authentication process. This is done using the _authentication.required_ function, normally in conjunction with a router. The example below shows this using the popular react-router:\n\n    import React, { Component } from 'react';\n    import authentication from 'react-azure-adb2c'\n    import { BrowserRouter as Router, Route, Switch } from \"react-router-dom\";\n    import HomePage from './Homepage'\n    import MembersArea from './MembersArea'\n    \n    class App extends Component {\n      render() {\n        return (\n          <Router basename={process.env.PUBLIC_URL}>\n            <Switch>\n              <Route exact path=\"/\" component={HomePage} />\n              <Route exact path=\"/membersArea\" component={authentication.required(MembersArea)}>\n            </Switch>\n          </Router>\n        );\n      }\n    }\n\n## Getting the Access Token\n\nSimply call the method _getAccessToken_:\n\n    import authentication from 'react-azure-adb2c'\n\n    // ...\n\n    const token = authentication.getAccessToken();\n\n## Signing Out\n\nTo sign out:\n\n    import authentication from 'react-azure-adb2c'\n\n    // ...\n\n    authentication.signOut();\n\n## Thanks\n\nTo build this I made use of the B2C site, the [MSAL library docs](https://github.com/AzureAD/microsoft-authentication-library-for-js), the [react-adal source](https://github.com/salvoravida/react-adal) and this [React MSAL sample](https://github.com/sunilbandla/react-msal-sample). Thanks!\n","readmeFilename":"README.md","gitHead":"f8c305eafae452893765d5f91171f225138fc3ac","_id":"@yoss-org/react-azure-adb2c@0.3.2-lcbeta9","_nodeVersion":"11.6.0","_npmVersion":"6.6.0","dist":{"integrity":"sha512-WiE1llwNV/0KbOMs6cNQ+iDUt6Nom9qnec7wKWeoVqD6REqfaCjjttveHYyK+7RcUdc3ZnxfijRMWcKOQnQ6sw==","shasum":"ff8b9df0f8f3390014247c6996f4b46031adf89d","tarball":"https://registry.npmjs.org/@yoss-org/react-azure-adb2c/-/react-azure-adb2c-0.3.2-lcbeta9.tgz","fileCount":9,"unpackedSize":177700,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcStxdCRA9TVsSAnZWagAA7yYQAJPL9XT380JmaFUKXdWq\nUdFf2RnEbAE0ubD0cnXkhzUO/a9Uuc5icBDdhYfIfu4A6L7OmD4qtYsZv4ue\n3eo8OpGsg1A1T1KqHFKCNhhnjIsi+33DbXWcWJw5Pr4L8XuSAI7H2amy6uqM\n6yy2xGAtHKRzhBmIkYThH6wk23I4Pa1bWQVHo9S9JvAjlpeMuCgucnmuLSs4\nm+jA59YceXAzHzwC9nw2j5QSKiYiNezqtM/2put/Kk71/Ac9k43E9xru2Pun\nvG8xPNCMFQ3PdtHFEIWgXAH5XPfT8W/8mYQiipUlVOXxDlw0/YgZo77kd5g2\n9uo8VunJdhlCaQgbtTqTJNoZq2Yz+h09ZRiSWi4EmtSTWqR4WDa4yDw1aeeB\nNTJtJ1aRI+u/pYJkZNCdjfP1dOFk6VeaWUDrT4FG9tGGzj/ygTsvyDTxbEn4\nK147K6o7P6ILy+6yxQsy5i3n0ZBT+DAWAzI24P6umtsMqCzHN6lad6aaESq6\n86DjY7rmpcxYcIT59J0SAqptl3SqCbcOM/7vLLOyk2SQJ71EdFiKh019wIjJ\n658NBdMhzDEhWzQRO/eRxfxdcvRNInA0A0rMfyix9xPsmiaXEtMZrJCKaZXP\nkFTQTkeF7pq/AtW+K2HRAeQx73JuGA2TdnJcSsHbt8DS7jnx8ir4//e0mBdq\nkYrh\r\n=wHe3\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCUr6bLnFCHENAsRSKq2E9WDAPzMPaLfEfw1RTiRuYZhAIgSppVYTxwJuckUxfGEiHiV7MB09vTCSKsgaKFuqtUuQk="}]},"maintainers":[{"name":"delwiv","email":"delwiv@gmail.com"},{"name":"fhou","email":"npm@bernardle.com"},{"name":"liryc","email":"cyril@oyst.com"},{"name":"nicolaschenet","email":"ironic51@gmail.com"}],"_npmUser":{"name":"delwiv","email":"delwiv@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/react-azure-adb2c_0.3.2-lcbeta9_1548409949011_0.5660568795632315"},"_hasShrinkwrap":false},"0.3.2-lcbeta10":{"name":"@yoss-org/react-azure-adb2c","version":"0.3.2-lcbeta10","description":"Authentication library for Azure AD B2C and ReactJS","main":"lib/react-azure-adb2c.js","scripts":{"compile":"cross-env NODE_ENV=production babel src --out-dir lib","prepublish":"npm run compile"},"repository":{"type":"git","url":"git+https://github.com/jamesrandall/react-azure-adb2c.git"},"keywords":["react","js","AAD","B2C","oauth","azure"],"author":{"name":"Cyril HAGEGE"},"license":"MIT","bugs":{"url":"https://github.com/JamesRandall/react-azure-adb2c/issues"},"homepage":"https://github.com/JamesRandall/react-azure-adb2c#readme","dependencies":{"msal":"^0.1.5"},"peerDependencies":{"react":"^15.0.0 || ^16.0.0"},"devDependencies":{"babel-cli":"^6.26.0","babel-core":"6.24.1","babel-eslint":"^8.0.3","babel-jest":"20.0.3","babel-loader":"7.0.0","babel-plugin-import":"^1.2.1","babel-polyfill":"^6.23.0","babel-preset-env":"^1.6.1","babel-preset-react-app":"^3.0.0","babel-runtime":"6.23.0","cross-env":"^5.1.4","eslint":"^4.12.1","eslint-config-airbnb":"^16.1.0","eslint-config-defaults":"^9.0.0","eslint-plugin-import":"^2.8.0","eslint-plugin-jsx-a11y":"^6.0.2","eslint-plugin-react":"^7.5.1","eslint-plugin-sort-imports-es6-autofix":"^0.3.0"},"readme":"# README\n\nAzure AD B2C is a cost effective identity provider covering social and enterprise logins but it can be awekward to integrate with - its documentation is currently not great and using it involves rooting around across multiple samples, the ADAL library, and the MSAL library.\n\nThat being the case I've focused this package on B2C although with minor changes it could be used more broadly. MSAL itself, which this library wraps, is rather generic but B2C has some specific requirements and I think half of the problem with the documentation is that you end up drifting across B2C and straight AD. I wanted to make things simpler for B2C.\n\nHopefully this will help people writing React apps. It makes use of MSAL underneath and the core of it (other than protecting routes) will probably work with other frameworks too but I use React at the moment. As it's an SPA my assumption in the library and documentation below is that you ultimately want to get an access token that you can use to call remote APIs. See this [Azure AD B2C post here](https://docs.microsoft.com/en-us/azure/active-directory-b2c/active-directory-b2c-access-tokens) for details on how to set this up on the B2C side.\n\nPRs welcome!\n\n## Installation\n\nIf you are using npm:\n\n    npm install react-azure-adb2c --save\n\nOr if you are using yarn:\n\n    yarn add react-azure-adb2c\n\n## Initializing the Library\n\nYou'll first need to load the module and pass some configuration to the library. Normally this would go in your index.js file:\n\n    import authentication from 'react-azure-adb2c';\n    authentication.initialize({\n        // optional, will default to this\n        instance: 'https://login.microsoftonline.com/tfp/', \n        // your B2C tenant\n        tenant: 'myb2ctenant.onmicrosoft.com',\n        // the policy to use to sign in, can also be a sign up or sign in policy\n        signInPolicy: 'mysigninpolicy',\n        // the policy to use for password reset\n        resetPolicy: 'mypasswordresetpolicy',\n        // the the B2C application you want to authenticate with (that's just a random GUID - get yours from the portal)\n        applicationId: '75ee2b43-ad2c-4366-9b8f-84b7d19d776e',\n        // where MSAL will store state - localStorage or sessionStorage\n        cacheLocation: 'sessionStorage',\n        // the scopes you want included in the access token\n        scopes: ['https://myb2ctenant.onmicrosoft.com/management/admin'],\n        // optional, the redirect URI - if not specified MSAL will pick up the location from window.href\n        redirectUri: 'http://localhost:3000',\n        // optional, the URI to redirect to after logout\n        postLogoutRedirectUri: 'http://myapp.com'\n    });\n    \n## Authenticating When The App Starts\n\nIf you want to set things up so that a user is authenticated as soon as they hit your app (for example if you've got a link to an app from a landing page) then, in index.js, wrap the lines of code that launch the React app with the _authentication.run_ function:\n\n    authentication.run(() => {\n      ReactDOM.render(<App />, document.getElementById('root'));\n      registerServiceWorker();  \n    });\n\n## Triggering Authentication Based on Components Mounting (and routing)\n\nIf you want to set things up so that a user is authenticated as they visit a part of the application that requires authentication then the appropriate components can be wrapped inside higher order components that will handle the authentication process. This is done using the _authentication.required_ function, normally in conjunction with a router. The example below shows this using the popular react-router:\n\n    import React, { Component } from 'react';\n    import authentication from 'react-azure-adb2c'\n    import { BrowserRouter as Router, Route, Switch } from \"react-router-dom\";\n    import HomePage from './Homepage'\n    import MembersArea from './MembersArea'\n    \n    class App extends Component {\n      render() {\n        return (\n          <Router basename={process.env.PUBLIC_URL}>\n            <Switch>\n              <Route exact path=\"/\" component={HomePage} />\n              <Route exact path=\"/membersArea\" component={authentication.required(MembersArea)}>\n            </Switch>\n          </Router>\n        );\n      }\n    }\n\n## Getting the Access Token\n\nSimply call the method _getAccessToken_:\n\n    import authentication from 'react-azure-adb2c'\n\n    // ...\n\n    const token = authentication.getAccessToken();\n\n## Signing Out\n\nTo sign out:\n\n    import authentication from 'react-azure-adb2c'\n\n    // ...\n\n    authentication.signOut();\n\n## Thanks\n\nTo build this I made use of the B2C site, the [MSAL library docs](https://github.com/AzureAD/microsoft-authentication-library-for-js), the [react-adal source](https://github.com/salvoravida/react-adal) and this [React MSAL sample](https://github.com/sunilbandla/react-msal-sample). Thanks!\n","readmeFilename":"README.md","gitHead":"f8c305eafae452893765d5f91171f225138fc3ac","_id":"@yoss-org/react-azure-adb2c@0.3.2-lcbeta10","_nodeVersion":"11.6.0","_npmVersion":"6.6.0","dist":{"integrity":"sha512-cycY9hHKc8dozV90VgLjRtZWzKnEkqBsRi5mGEMqYI2jS8VGXVYInJpRvnxd2aKLjqhhl7TdZHeU5rlsqM6xmQ==","shasum":"fd75b65e079e9678b7fa47ff30264a26b82e4a0d","tarball":"https://registry.npmjs.org/@yoss-org/react-azure-adb2c/-/react-azure-adb2c-0.3.2-lcbeta10.tgz","fileCount":9,"unpackedSize":177920,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcSuczCRA9TVsSAnZWagAAWmoP+wV/rxIgNALJNIvrp9ea\nKPCCPIKFbFZ1ZNQVUtzaUXTga9EfTbyDjnJwg8yDtzST+zZaEaO5Zk4P5+Uz\nLcKSC2kczHbOWdCo0ezqdivLnhR+tG4XrIdCgeP7iGmy7ZWzCRTgzZl24ABd\nI2tw2muRgQqz6VaIjtrijDKEa7oHLxQpaUJFwL6C5ILMjvzJbsf8DJPFXGj4\nndVAdtsvngJLKXawcLQHTMsBiA0xnaQhpdB7y5rVWNDG3wlK51buHLuEAMLY\nHB9BGGt66+mHvIu7OdCKB4HY1rnt9ZWbGg1sr/4Cxv+CyrVXNxgPGKrPJRRN\n5B4vKLMNyCBtUmmvl0kpPcL1ymkTiZYukqdHxs8q1fyaqv74YOxA0Wv5UMOu\nClTSZ8N+QKW2iCu4Eg2UXEsOu2b2Xka4ko+O8gTYsKfWhZ0G629GOBZz6wui\nB+ZPsjmlHYpabbWYglQfx2QKKSVZ5UmaklCQC2PrbeliebLDAWveyuG3tdLW\nS12p3WtPyTpr17QitE0VHxvJqh2MOI7z52zpp7M+I9p5usSiMbtvZJfrt00r\nxFxTEYYx5iN7dIUnjA6KZu9TUoTrlZU5Ga+rw389SkAUU8d+VUOp35r0FPDL\n7CxgV+JLMK6aaNzc37GCgYaTJuLWtVwf64AWRBQB614JzFGv2EA8AmfLP0G/\nw//t\r\n=JeqG\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDoaRwECBatBXgZuIq7dR13DP5lBVLkN9aDX8Nq2Z1cBgIgMRaC06LMGO52oHeeAMiWk7iBSBe2SBZkdMe/nz/r4Dk="}]},"maintainers":[{"name":"delwiv","email":"delwiv@gmail.com"},{"name":"fhou","email":"npm@bernardle.com"},{"name":"liryc","email":"cyril@oyst.com"},{"name":"nicolaschenet","email":"ironic51@gmail.com"}],"_npmUser":{"name":"delwiv","email":"delwiv@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/react-azure-adb2c_0.3.2-lcbeta10_1548412722431_0.7831007130812968"},"_hasShrinkwrap":false},"0.3.2-lcbeta11":{"name":"@yoss-org/react-azure-adb2c","version":"0.3.2-lcbeta11","description":"Authentication library for Azure AD B2C and ReactJS","main":"lib/react-azure-adb2c.js","scripts":{"compile":"cross-env NODE_ENV=production babel src --out-dir lib","prepublish":"npm run compile"},"repository":{"type":"git","url":"git+https://github.com/jamesrandall/react-azure-adb2c.git"},"keywords":["react","js","AAD","B2C","oauth","azure"],"author":{"name":"Cyril HAGEGE"},"license":"MIT","bugs":{"url":"https://github.com/JamesRandall/react-azure-adb2c/issues"},"homepage":"https://github.com/JamesRandall/react-azure-adb2c#readme","dependencies":{"msal":"^0.1.5"},"peerDependencies":{"react":"^15.0.0 || ^16.0.0"},"devDependencies":{"babel-cli":"^6.26.0","babel-core":"6.24.1","babel-eslint":"^8.0.3","babel-jest":"20.0.3","babel-loader":"7.0.0","babel-plugin-import":"^1.2.1","babel-polyfill":"^6.23.0","babel-preset-env":"^1.6.1","babel-preset-react-app":"^3.0.0","babel-runtime":"6.23.0","cross-env":"^5.1.4","eslint":"^4.12.1","eslint-config-airbnb":"^16.1.0","eslint-config-defaults":"^9.0.0","eslint-plugin-import":"^2.8.0","eslint-plugin-jsx-a11y":"^6.0.2","eslint-plugin-react":"^7.5.1","eslint-plugin-sort-imports-es6-autofix":"^0.3.0"},"readme":"# README\n\nAzure AD B2C is a cost effective identity provider covering social and enterprise logins but it can be awekward to integrate with - its documentation is currently not great and using it involves rooting around across multiple samples, the ADAL library, and the MSAL library.\n\nThat being the case I've focused this package on B2C although with minor changes it could be used more broadly. MSAL itself, which this library wraps, is rather generic but B2C has some specific requirements and I think half of the problem with the documentation is that you end up drifting across B2C and straight AD. I wanted to make things simpler for B2C.\n\nHopefully this will help people writing React apps. It makes use of MSAL underneath and the core of it (other than protecting routes) will probably work with other frameworks too but I use React at the moment. As it's an SPA my assumption in the library and documentation below is that you ultimately want to get an access token that you can use to call remote APIs. See this [Azure AD B2C post here](https://docs.microsoft.com/en-us/azure/active-directory-b2c/active-directory-b2c-access-tokens) for details on how to set this up on the B2C side.\n\nPRs welcome!\n\n## Installation\n\nIf you are using npm:\n\n    npm install react-azure-adb2c --save\n\nOr if you are using yarn:\n\n    yarn add react-azure-adb2c\n\n## Initializing the Library\n\nYou'll first need to load the module and pass some configuration to the library. Normally this would go in your index.js file:\n\n    import authentication from 'react-azure-adb2c';\n    authentication.initialize({\n        // optional, will default to this\n        instance: 'https://login.microsoftonline.com/tfp/', \n        // your B2C tenant\n        tenant: 'myb2ctenant.onmicrosoft.com',\n        // the policy to use to sign in, can also be a sign up or sign in policy\n        signInPolicy: 'mysigninpolicy',\n        // the policy to use for password reset\n        resetPolicy: 'mypasswordresetpolicy',\n        // the the B2C application you want to authenticate with (that's just a random GUID - get yours from the portal)\n        applicationId: '75ee2b43-ad2c-4366-9b8f-84b7d19d776e',\n        // where MSAL will store state - localStorage or sessionStorage\n        cacheLocation: 'sessionStorage',\n        // the scopes you want included in the access token\n        scopes: ['https://myb2ctenant.onmicrosoft.com/management/admin'],\n        // optional, the redirect URI - if not specified MSAL will pick up the location from window.href\n        redirectUri: 'http://localhost:3000',\n        // optional, the URI to redirect to after logout\n        postLogoutRedirectUri: 'http://myapp.com'\n    });\n    \n## Authenticating When The App Starts\n\nIf you want to set things up so that a user is authenticated as soon as they hit your app (for example if you've got a link to an app from a landing page) then, in index.js, wrap the lines of code that launch the React app with the _authentication.run_ function:\n\n    authentication.run(() => {\n      ReactDOM.render(<App />, document.getElementById('root'));\n      registerServiceWorker();  \n    });\n\n## Triggering Authentication Based on Components Mounting (and routing)\n\nIf you want to set things up so that a user is authenticated as they visit a part of the application that requires authentication then the appropriate components can be wrapped inside higher order components that will handle the authentication process. This is done using the _authentication.required_ function, normally in conjunction with a router. The example below shows this using the popular react-router:\n\n    import React, { Component } from 'react';\n    import authentication from 'react-azure-adb2c'\n    import { BrowserRouter as Router, Route, Switch } from \"react-router-dom\";\n    import HomePage from './Homepage'\n    import MembersArea from './MembersArea'\n    \n    class App extends Component {\n      render() {\n        return (\n          <Router basename={process.env.PUBLIC_URL}>\n            <Switch>\n              <Route exact path=\"/\" component={HomePage} />\n              <Route exact path=\"/membersArea\" component={authentication.required(MembersArea)}>\n            </Switch>\n          </Router>\n        );\n      }\n    }\n\n## Getting the Access Token\n\nSimply call the method _getAccessToken_:\n\n    import authentication from 'react-azure-adb2c'\n\n    // ...\n\n    const token = authentication.getAccessToken();\n\n## Signing Out\n\nTo sign out:\n\n    import authentication from 'react-azure-adb2c'\n\n    // ...\n\n    authentication.signOut();\n\n## Thanks\n\nTo build this I made use of the B2C site, the [MSAL library docs](https://github.com/AzureAD/microsoft-authentication-library-for-js), the [react-adal source](https://github.com/salvoravida/react-adal) and this [React MSAL sample](https://github.com/sunilbandla/react-msal-sample). Thanks!\n","readmeFilename":"README.md","gitHead":"f8c305eafae452893765d5f91171f225138fc3ac","_id":"@yoss-org/react-azure-adb2c@0.3.2-lcbeta11","_nodeVersion":"11.6.0","_npmVersion":"6.6.0","dist":{"integrity":"sha512-va/lGXudmptk6t0YEAddvj4LF7cRhR8L3lkQCvWgcSLdWY8LVMnk0MALz8pe1jgCqxeWwMjQ86QAA+AtgFnKGg==","shasum":"ed4aa12ecfd291e7e156889487fafab5c8e8247b","tarball":"https://registry.npmjs.org/@yoss-org/react-azure-adb2c/-/react-azure-adb2c-0.3.2-lcbeta11.tgz","fileCount":9,"unpackedSize":178019,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcSuhCCRA9TVsSAnZWagAA71kP/1nKa7Nh5qYEAH+lSORQ\n+5zX1uqtXhxs9r5Uv046oByx90CRFkPm2xA1LkrTkeuk+c/7Vjc2Jwcqhj7F\nvSD1tzyGBVK8HbkHDNRbTAh6y5+QNbpYrLPU9owACz0X2Lqj88E60pkdsuM2\nZe06fmgaBBrTpPqYYfsZMRxu37AZZnJ8PVPRkbFC4FZaxuGUCI2xUmzlWKLm\n6ZqgkN5wty91Xo2TdNyPv+BGL/YRRRJYi1vmjQ7oRgnqbx2JUg3jJkAs6kl0\n9EDzGVY/aAqJlba/10o0oNHr1FWXibpTOKdz1ZRemBf5MATXOrgLr9+KuJ7i\nBw+WgwHsqLBMBeAupodcXpOrXSGKkQyCks/UTRNk0xCI/RIga0rNw16nRgvI\nj5oyRhnWONtLIQmEABj5Pdw4kuYOAPaSwFnDQbAWJqTSVecz9XKtPqINOUWH\n8JSaeHpuN6UdoidxdSMrw62fRmb8WTq+b7bHtha8Q4CHiJcTbw3r1E00tD6e\n+GqyAHoz+2QyHRqR49PpxRKVIL7wXiFeXY5OUB0tg18DN6QrRVTiEEeV744R\nqkYtHa/4/88I48PRwOiJ3DEuE/fZ+DQdZEC7/nOz3mpJC5kF6l6hrc+vAaC6\nDMmQVMmNTjd5oLfWXtqM3W3rO9Xh0QYk21tphjqDRHjnZ6kaUTg5bZLgwI6w\nBX4l\r\n=SjSM\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDt6Vj4m3Ti9XrMS9whFQ/wXeQK48fMqH4PQp48wrZF/AiAazchL3S0Pg2OBntpksM8XLE5tTaCW2MmsD4tKmmOzDA=="}]},"maintainers":[{"name":"delwiv","email":"delwiv@gmail.com"},{"name":"fhou","email":"npm@bernardle.com"},{"name":"liryc","email":"cyril@oyst.com"},{"name":"nicolaschenet","email":"ironic51@gmail.com"}],"_npmUser":{"name":"delwiv","email":"delwiv@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/react-azure-adb2c_0.3.2-lcbeta11_1548412994118_0.25652739604336383"},"_hasShrinkwrap":false},"0.3.2-lcbeta12":{"name":"@yoss-org/react-azure-adb2c","version":"0.3.2-lcbeta12","description":"Authentication library for Azure AD B2C and ReactJS","main":"lib/react-azure-adb2c.js","scripts":{"compile":"cross-env NODE_ENV=production babel src --out-dir lib","prepublish":"npm run compile"},"repository":{"type":"git","url":"git+https://github.com/jamesrandall/react-azure-adb2c.git"},"keywords":["react","js","AAD","B2C","oauth","azure"],"author":{"name":"Cyril HAGEGE"},"license":"MIT","bugs":{"url":"https://github.com/JamesRandall/react-azure-adb2c/issues"},"homepage":"https://github.com/JamesRandall/react-azure-adb2c#readme","dependencies":{"msal":"^0.1.5"},"peerDependencies":{"react":"^15.0.0 || ^16.0.0"},"devDependencies":{"babel-cli":"^6.26.0","babel-core":"6.24.1","babel-eslint":"^8.0.3","babel-jest":"20.0.3","babel-loader":"7.0.0","babel-plugin-import":"^1.2.1","babel-polyfill":"^6.23.0","babel-preset-env":"^1.6.1","babel-preset-react-app":"^3.0.0","babel-runtime":"6.23.0","cross-env":"^5.1.4","eslint":"^4.12.1","eslint-config-airbnb":"^16.1.0","eslint-config-defaults":"^9.0.0","eslint-plugin-import":"^2.8.0","eslint-plugin-jsx-a11y":"^6.0.2","eslint-plugin-react":"^7.5.1","eslint-plugin-sort-imports-es6-autofix":"^0.3.0"},"readme":"# README\n\nAzure AD B2C is a cost effective identity provider covering social and enterprise logins but it can be awekward to integrate with - its documentation is currently not great and using it involves rooting around across multiple samples, the ADAL library, and the MSAL library.\n\nThat being the case I've focused this package on B2C although with minor changes it could be used more broadly. MSAL itself, which this library wraps, is rather generic but B2C has some specific requirements and I think half of the problem with the documentation is that you end up drifting across B2C and straight AD. I wanted to make things simpler for B2C.\n\nHopefully this will help people writing React apps. It makes use of MSAL underneath and the core of it (other than protecting routes) will probably work with other frameworks too but I use React at the moment. As it's an SPA my assumption in the library and documentation below is that you ultimately want to get an access token that you can use to call remote APIs. See this [Azure AD B2C post here](https://docs.microsoft.com/en-us/azure/active-directory-b2c/active-directory-b2c-access-tokens) for details on how to set this up on the B2C side.\n\nPRs welcome!\n\n## Installation\n\nIf you are using npm:\n\n    npm install react-azure-adb2c --save\n\nOr if you are using yarn:\n\n    yarn add react-azure-adb2c\n\n## Initializing the Library\n\nYou'll first need to load the module and pass some configuration to the library. Normally this would go in your index.js file:\n\n    import authentication from 'react-azure-adb2c';\n    authentication.initialize({\n        // optional, will default to this\n        instance: 'https://login.microsoftonline.com/tfp/', \n        // your B2C tenant\n        tenant: 'myb2ctenant.onmicrosoft.com',\n        // the policy to use to sign in, can also be a sign up or sign in policy\n        signInPolicy: 'mysigninpolicy',\n        // the policy to use for password reset\n        resetPolicy: 'mypasswordresetpolicy',\n        // the the B2C application you want to authenticate with (that's just a random GUID - get yours from the portal)\n        applicationId: '75ee2b43-ad2c-4366-9b8f-84b7d19d776e',\n        // where MSAL will store state - localStorage or sessionStorage\n        cacheLocation: 'sessionStorage',\n        // the scopes you want included in the access token\n        scopes: ['https://myb2ctenant.onmicrosoft.com/management/admin'],\n        // optional, the redirect URI - if not specified MSAL will pick up the location from window.href\n        redirectUri: 'http://localhost:3000',\n        // optional, the URI to redirect to after logout\n        postLogoutRedirectUri: 'http://myapp.com'\n    });\n    \n## Authenticating When The App Starts\n\nIf you want to set things up so that a user is authenticated as soon as they hit your app (for example if you've got a link to an app from a landing page) then, in index.js, wrap the lines of code that launch the React app with the _authentication.run_ function:\n\n    authentication.run(() => {\n      ReactDOM.render(<App />, document.getElementById('root'));\n      registerServiceWorker();  \n    });\n\n## Triggering Authentication Based on Components Mounting (and routing)\n\nIf you want to set things up so that a user is authenticated as they visit a part of the application that requires authentication then the appropriate components can be wrapped inside higher order components that will handle the authentication process. This is done using the _authentication.required_ function, normally in conjunction with a router. The example below shows this using the popular react-router:\n\n    import React, { Component } from 'react';\n    import authentication from 'react-azure-adb2c'\n    import { BrowserRouter as Router, Route, Switch } from \"react-router-dom\";\n    import HomePage from './Homepage'\n    import MembersArea from './MembersArea'\n    \n    class App extends Component {\n      render() {\n        return (\n          <Router basename={process.env.PUBLIC_URL}>\n            <Switch>\n              <Route exact path=\"/\" component={HomePage} />\n              <Route exact path=\"/membersArea\" component={authentication.required(MembersArea)}>\n            </Switch>\n          </Router>\n        );\n      }\n    }\n\n## Getting the Access Token\n\nSimply call the method _getAccessToken_:\n\n    import authentication from 'react-azure-adb2c'\n\n    // ...\n\n    const token = authentication.getAccessToken();\n\n## Signing Out\n\nTo sign out:\n\n    import authentication from 'react-azure-adb2c'\n\n    // ...\n\n    authentication.signOut();\n\n## Thanks\n\nTo build this I made use of the B2C site, the [MSAL library docs](https://github.com/AzureAD/microsoft-authentication-library-for-js), the [react-adal source](https://github.com/salvoravida/react-adal) and this [React MSAL sample](https://github.com/sunilbandla/react-msal-sample). Thanks!\n","readmeFilename":"README.md","gitHead":"f8c305eafae452893765d5f91171f225138fc3ac","_id":"@yoss-org/react-azure-adb2c@0.3.2-lcbeta12","_nodeVersion":"11.6.0","_npmVersion":"6.6.0","dist":{"integrity":"sha512-SN/+uyWzl1dK6GlJCPtkJQ3KiIK/bxr1sxcfnY2YVknVVc1VwzSWKMLLxoT4u7qPyacsA+FD9UWvUV3niJvH0w==","shasum":"cdff211a0b9ed4c31a909170568331cbe082f18a","tarball":"https://registry.npmjs.org/@yoss-org/react-azure-adb2c/-/react-azure-adb2c-0.3.2-lcbeta12.tgz","fileCount":9,"unpackedSize":177792,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcSu4nCRA9TVsSAnZWagAAF1AQAIeNax+wgRM0iUOM5IZY\n/X+y7A4dYPtXewFh2TM7modmZ1nWUjvNNR7MngeEVpET8G3BHm06rKolatco\nzUHBlcK4q3UbzSOPxwi+RaFj6K6fYB27Yd2oYpJYorh+SxvyJsKJsKwJ44nu\nXpHzy9h2tzzgco3kTw+uqHUTpjkp9hcOA2b58g4vtqQrx22veHUzOOf/JqYs\n18dUS2I4QaqKyv1vYaGhrDbKXwcys6OuAnQx62C88wGe8snZrbkRGDctTUKw\n7GJ/q5q6y60sao6hIaVi+GiB0PZGNc0lj6UXWoY2aUBxbi9RF+I5Bsuwd3nm\n8kppNkd5N+DQeWZXozVK3Nu6c9RFSyc8wXXst6blqSaqX7GlJ08/UCkqhs4+\nhbMAWTZ8D6bNADyYXZgLVfw1awh5mIUxCr1BEqbut6OlVoKdkvE2qlEQ+3jd\nvKnvr4C2pyE6juw3J8060MuX2Fg+2Voi38plKFKToovmpQpIx0j7yUtErpjB\nT4OGC532oS8DXHWZ3CFnpzSMdygvNEs1GsEOBAehS9GYX3pC6UxfQ3ziZw69\nw8r177VwbHR2rdhXts5xRSxGDKqT9pwCnG1kBUtdhjuekjVZ4wEQBU57VUmT\nXI8RSrXKzKNg0m8IVtdhNY1s2uLc4FMdAtVD80bDIFnn2p9Tzy+m9CbYL66P\njUKt\r\n=XIeY\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGYU4G2qL9Jda/zuP9EC/5AbTKMiiQyYv3ZKZd9y+kDQAiEAo5/mGbXOUht0wejU7L4+tINixufIhoFJQGE2g3ihF/I="}]},"maintainers":[{"name":"delwiv","email":"delwiv@gmail.com"},{"name":"fhou","email":"npm@bernardle.com"},{"name":"liryc","email":"cyril@oyst.com"},{"name":"nicolaschenet","email":"ironic51@gmail.com"}],"_npmUser":{"name":"delwiv","email":"delwiv@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/react-azure-adb2c_0.3.2-lcbeta12_1548414502853_0.9952692209304226"},"_hasShrinkwrap":false},"0.3.2-lcbeta13":{"name":"@yoss-org/react-azure-adb2c","version":"0.3.2-lcbeta13","description":"Authentication library for Azure AD B2C and ReactJS","main":"lib/react-azure-adb2c.js","scripts":{"compile":"cross-env NODE_ENV=production babel src --out-dir lib","prepublish":"npm run compile"},"repository":{"type":"git","url":"git+https://github.com/jamesrandall/react-azure-adb2c.git"},"keywords":["react","js","AAD","B2C","oauth","azure"],"author":{"name":"Cyril HAGEGE"},"license":"MIT","bugs":{"url":"https://github.com/JamesRandall/react-azure-adb2c/issues"},"homepage":"https://github.com/JamesRandall/react-azure-adb2c#readme","dependencies":{"msal":"^0.1.5"},"peerDependencies":{"react":"^15.0.0 || ^16.0.0"},"devDependencies":{"babel-cli":"^6.26.0","babel-core":"6.24.1","babel-eslint":"^8.0.3","babel-jest":"20.0.3","babel-loader":"7.0.0","babel-plugin-import":"^1.2.1","babel-polyfill":"^6.23.0","babel-preset-env":"^1.6.1","babel-preset-react-app":"^3.0.0","babel-runtime":"6.23.0","cross-env":"^5.1.4","eslint":"^4.12.1","eslint-config-airbnb":"^16.1.0","eslint-config-defaults":"^9.0.0","eslint-plugin-import":"^2.8.0","eslint-plugin-jsx-a11y":"^6.0.2","eslint-plugin-react":"^7.5.1","eslint-plugin-sort-imports-es6-autofix":"^0.3.0"},"readme":"# README\n\nAzure AD B2C is a cost effective identity provider covering social and enterprise logins but it can be awekward to integrate with - its documentation is currently not great and using it involves rooting around across multiple samples, the ADAL library, and the MSAL library.\n\nThat being the case I've focused this package on B2C although with minor changes it could be used more broadly. MSAL itself, which this library wraps, is rather generic but B2C has some specific requirements and I think half of the problem with the documentation is that you end up drifting across B2C and straight AD. I wanted to make things simpler for B2C.\n\nHopefully this will help people writing React apps. It makes use of MSAL underneath and the core of it (other than protecting routes) will probably work with other frameworks too but I use React at the moment. As it's an SPA my assumption in the library and documentation below is that you ultimately want to get an access token that you can use to call remote APIs. See this [Azure AD B2C post here](https://docs.microsoft.com/en-us/azure/active-directory-b2c/active-directory-b2c-access-tokens) for details on how to set this up on the B2C side.\n\nPRs welcome!\n\n## Installation\n\nIf you are using npm:\n\n    npm install react-azure-adb2c --save\n\nOr if you are using yarn:\n\n    yarn add react-azure-adb2c\n\n## Initializing the Library\n\nYou'll first need to load the module and pass some configuration to the library. Normally this would go in your index.js file:\n\n    import authentication from 'react-azure-adb2c';\n    authentication.initialize({\n        // optional, will default to this\n        instance: 'https://login.microsoftonline.com/tfp/', \n        // your B2C tenant\n        tenant: 'myb2ctenant.onmicrosoft.com',\n        // the policy to use to sign in, can also be a sign up or sign in policy\n        signInPolicy: 'mysigninpolicy',\n        // the policy to use for password reset\n        resetPolicy: 'mypasswordresetpolicy',\n        // the the B2C application you want to authenticate with (that's just a random GUID - get yours from the portal)\n        applicationId: '75ee2b43-ad2c-4366-9b8f-84b7d19d776e',\n        // where MSAL will store state - localStorage or sessionStorage\n        cacheLocation: 'sessionStorage',\n        // the scopes you want included in the access token\n        scopes: ['https://myb2ctenant.onmicrosoft.com/management/admin'],\n        // optional, the redirect URI - if not specified MSAL will pick up the location from window.href\n        redirectUri: 'http://localhost:3000',\n        // optional, the URI to redirect to after logout\n        postLogoutRedirectUri: 'http://myapp.com'\n    });\n    \n## Authenticating When The App Starts\n\nIf you want to set things up so that a user is authenticated as soon as they hit your app (for example if you've got a link to an app from a landing page) then, in index.js, wrap the lines of code that launch the React app with the _authentication.run_ function:\n\n    authentication.run(() => {\n      ReactDOM.render(<App />, document.getElementById('root'));\n      registerServiceWorker();  \n    });\n\n## Triggering Authentication Based on Components Mounting (and routing)\n\nIf you want to set things up so that a user is authenticated as they visit a part of the application that requires authentication then the appropriate components can be wrapped inside higher order components that will handle the authentication process. This is done using the _authentication.required_ function, normally in conjunction with a router. The example below shows this using the popular react-router:\n\n    import React, { Component } from 'react';\n    import authentication from 'react-azure-adb2c'\n    import { BrowserRouter as Router, Route, Switch } from \"react-router-dom\";\n    import HomePage from './Homepage'\n    import MembersArea from './MembersArea'\n    \n    class App extends Component {\n      render() {\n        return (\n          <Router basename={process.env.PUBLIC_URL}>\n            <Switch>\n              <Route exact path=\"/\" component={HomePage} />\n              <Route exact path=\"/membersArea\" component={authentication.required(MembersArea)}>\n            </Switch>\n          </Router>\n        );\n      }\n    }\n\n## Getting the Access Token\n\nSimply call the method _getAccessToken_:\n\n    import authentication from 'react-azure-adb2c'\n\n    // ...\n\n    const token = authentication.getAccessToken();\n\n## Signing Out\n\nTo sign out:\n\n    import authentication from 'react-azure-adb2c'\n\n    // ...\n\n    authentication.signOut();\n\n## Thanks\n\nTo build this I made use of the B2C site, the [MSAL library docs](https://github.com/AzureAD/microsoft-authentication-library-for-js), the [react-adal source](https://github.com/salvoravida/react-adal) and this [React MSAL sample](https://github.com/sunilbandla/react-msal-sample). Thanks!\n","readmeFilename":"README.md","gitHead":"f8c305eafae452893765d5f91171f225138fc3ac","_id":"@yoss-org/react-azure-adb2c@0.3.2-lcbeta13","_nodeVersion":"11.6.0","_npmVersion":"6.6.0","dist":{"integrity":"sha512-xPrB3KzMvYeroFKayr4Kuj683acWpdSBwntpveXC1peWg8k31UKZzuRcdo8CiIth5OfcbyAuuw98yqVKk8QDnQ==","shasum":"608c4781ed941e5d0eb99271396b4da4d0628660","tarball":"https://registry.npmjs.org/@yoss-org/react-azure-adb2c/-/react-azure-adb2c-0.3.2-lcbeta13.tgz","fileCount":9,"unpackedSize":177928,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcSu6pCRA9TVsSAnZWagAA2t8QAJAFadGGpUJFQZKwEhVR\nHxLcLrrlfSfOy1WxeZ32pk+eZIy/8ECh7QQdZW4lUEbDS8yeGNfSPqoYoNeS\na5qKRZ/ZazxOjCijAEJlke33aJBu/KnZYAMpdho7/BYaPcU+vbZU1hOW4n0D\njFvxrR3e9uXGVjdpcygKbL/3OCUVq2fSr5z8KmGEhhcZyBRYjjd862ha0WhN\n8+Q7JxaYenvwnizWb24ds8qVj1d3yg+z4FQii4rF7XjIV304wVKpOmDXYIy0\nHVnTAJu/hX4Y4L/39Bt3bMPJBkxx+9etVuFfHUfbv/DvoFIAntFMj4kiGUE8\nEHUavOf244ZdNrXsaVO44ZW8dN1JZX5R1pQ1yjeauzRdx3TtGT326yS3blPl\nBiDHDBUpXDu4i9NPGOuXSBTwYqURssxhpk1XVvFBeTwiKEVtoQNHO7W/q07d\neHh6sSMYPL0jyfJWkIBPcOxtqYeUEInNi0BV0MHTwQUMlvKKtWJnq4HM6yGL\nhkR12wjKCELzArvZkklc5YR6UiQ0QemTtkjRupZze7DUVh8GX3a9LhagTO/N\nXaQRc12MPeJr/JvTaMwfWCScYan8wh/w98Xs3+rbhH7yjtU5FzEHZNh80hXh\ndJLf2xoDnv/oXa2+oXrWqbyJ6VFD1RNVdLKeZRmhkd4+J0Q67/ZRmkmfDq9z\nA0wc\r\n=Zdlq\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD42AFYk1h38d1qeBTa15FMLLIuGEaNhxssNI7skK4u7wIhAMVckL3Dtrtu4S5bTNG4VI9+TkBbSk50ZDg24W1tDZfT"}]},"maintainers":[{"name":"delwiv","email":"delwiv@gmail.com"},{"name":"fhou","email":"npm@bernardle.com"},{"name":"liryc","email":"cyril@oyst.com"},{"name":"nicolaschenet","email":"ironic51@gmail.com"}],"_npmUser":{"name":"delwiv","email":"delwiv@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/react-azure-adb2c_0.3.2-lcbeta13_1548414633032_0.6426701327878912"},"_hasShrinkwrap":false},"0.3.2-lcbeta14":{"name":"@yoss-org/react-azure-adb2c","version":"0.3.2-lcbeta14","description":"Authentication library for Azure AD B2C and ReactJS","main":"lib/react-azure-adb2c.js","scripts":{"compile":"cross-env NODE_ENV=production babel src --out-dir lib","prepublish":"npm run compile"},"repository":{"type":"git","url":"git+https://github.com/jamesrandall/react-azure-adb2c.git"},"keywords":["react","js","AAD","B2C","oauth","azure"],"author":{"name":"Cyril HAGEGE"},"license":"MIT","bugs":{"url":"https://github.com/JamesRandall/react-azure-adb2c/issues"},"homepage":"https://github.com/JamesRandall/react-azure-adb2c#readme","dependencies":{"msal":"^0.1.5"},"peerDependencies":{"react":"^15.0.0 || ^16.0.0"},"devDependencies":{"babel-cli":"^6.26.0","babel-core":"6.24.1","babel-eslint":"^8.0.3","babel-jest":"20.0.3","babel-loader":"7.0.0","babel-plugin-import":"^1.2.1","babel-polyfill":"^6.23.0","babel-preset-env":"^1.6.1","babel-preset-react-app":"^3.0.0","babel-runtime":"6.23.0","cross-env":"^5.1.4","eslint":"^4.12.1","eslint-config-airbnb":"^16.1.0","eslint-config-defaults":"^9.0.0","eslint-plugin-import":"^2.8.0","eslint-plugin-jsx-a11y":"^6.0.2","eslint-plugin-react":"^7.5.1","eslint-plugin-sort-imports-es6-autofix":"^0.3.0"},"readme":"# README\n\nAzure AD B2C is a cost effective identity provider covering social and enterprise logins but it can be awekward to integrate with - its documentation is currently not great and using it involves rooting around across multiple samples, the ADAL library, and the MSAL library.\n\nThat being the case I've focused this package on B2C although with minor changes it could be used more broadly. MSAL itself, which this library wraps, is rather generic but B2C has some specific requirements and I think half of the problem with the documentation is that you end up drifting across B2C and straight AD. I wanted to make things simpler for B2C.\n\nHopefully this will help people writing React apps. It makes use of MSAL underneath and the core of it (other than protecting routes) will probably work with other frameworks too but I use React at the moment. As it's an SPA my assumption in the library and documentation below is that you ultimately want to get an access token that you can use to call remote APIs. See this [Azure AD B2C post here](https://docs.microsoft.com/en-us/azure/active-directory-b2c/active-directory-b2c-access-tokens) for details on how to set this up on the B2C side.\n\nPRs welcome!\n\n## Installation\n\nIf you are using npm:\n\n    npm install react-azure-adb2c --save\n\nOr if you are using yarn:\n\n    yarn add react-azure-adb2c\n\n## Initializing the Library\n\nYou'll first need to load the module and pass some configuration to the library. Normally this would go in your index.js file:\n\n    import authentication from 'react-azure-adb2c';\n    authentication.initialize({\n        // optional, will default to this\n        instance: 'https://login.microsoftonline.com/tfp/', \n        // your B2C tenant\n        tenant: 'myb2ctenant.onmicrosoft.com',\n        // the policy to use to sign in, can also be a sign up or sign in policy\n        signInPolicy: 'mysigninpolicy',\n        // the policy to use for password reset\n        resetPolicy: 'mypasswordresetpolicy',\n        // the the B2C application you want to authenticate with (that's just a random GUID - get yours from the portal)\n        applicationId: '75ee2b43-ad2c-4366-9b8f-84b7d19d776e',\n        // where MSAL will store state - localStorage or sessionStorage\n        cacheLocation: 'sessionStorage',\n        // the scopes you want included in the access token\n        scopes: ['https://myb2ctenant.onmicrosoft.com/management/admin'],\n        // optional, the redirect URI - if not specified MSAL will pick up the location from window.href\n        redirectUri: 'http://localhost:3000',\n        // optional, the URI to redirect to after logout\n        postLogoutRedirectUri: 'http://myapp.com'\n    });\n    \n## Authenticating When The App Starts\n\nIf you want to set things up so that a user is authenticated as soon as they hit your app (for example if you've got a link to an app from a landing page) then, in index.js, wrap the lines of code that launch the React app with the _authentication.run_ function:\n\n    authentication.run(() => {\n      ReactDOM.render(<App />, document.getElementById('root'));\n      registerServiceWorker();  \n    });\n\n## Triggering Authentication Based on Components Mounting (and routing)\n\nIf you want to set things up so that a user is authenticated as they visit a part of the application that requires authentication then the appropriate components can be wrapped inside higher order components that will handle the authentication process. This is done using the _authentication.required_ function, normally in conjunction with a router. The example below shows this using the popular react-router:\n\n    import React, { Component } from 'react';\n    import authentication from 'react-azure-adb2c'\n    import { BrowserRouter as Router, Route, Switch } from \"react-router-dom\";\n    import HomePage from './Homepage'\n    import MembersArea from './MembersArea'\n    \n    class App extends Component {\n      render() {\n        return (\n          <Router basename={process.env.PUBLIC_URL}>\n            <Switch>\n              <Route exact path=\"/\" component={HomePage} />\n              <Route exact path=\"/membersArea\" component={authentication.required(MembersArea)}>\n            </Switch>\n          </Router>\n        );\n      }\n    }\n\n## Getting the Access Token\n\nSimply call the method _getAccessToken_:\n\n    import authentication from 'react-azure-adb2c'\n\n    // ...\n\n    const token = authentication.getAccessToken();\n\n## Signing Out\n\nTo sign out:\n\n    import authentication from 'react-azure-adb2c'\n\n    // ...\n\n    authentication.signOut();\n\n## Thanks\n\nTo build this I made use of the B2C site, the [MSAL library docs](https://github.com/AzureAD/microsoft-authentication-library-for-js), the [react-adal source](https://github.com/salvoravida/react-adal) and this [React MSAL sample](https://github.com/sunilbandla/react-msal-sample). Thanks!\n","readmeFilename":"README.md","gitHead":"f8c305eafae452893765d5f91171f225138fc3ac","_id":"@yoss-org/react-azure-adb2c@0.3.2-lcbeta14","_nodeVersion":"11.6.0","_npmVersion":"6.6.0","dist":{"integrity":"sha512-KQ9/oMAoTsRSI/1r6ytEuC3h7KkQyhirOhtJxYGzZqCVN5O3nr4RXoVtEst22cqP4JLJSRmU25Rxby8JMBAdng==","shasum":"77a9bb5e808e5da958346b1839819e09b4fe89eb","tarball":"https://registry.npmjs.org/@yoss-org/react-azure-adb2c/-/react-azure-adb2c-0.3.2-lcbeta14.tgz","fileCount":9,"unpackedSize":177959,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcSu8pCRA9TVsSAnZWagAAoGMQAKPT9BSw4CyUlY2wnW6b\nKwNq0ltmOLDviQj7vEYSVxRScwS1+piIQWM2jKJcoB5d+kii/Mhc4rZEN3l8\npswKN8l5YRur5qyx8ZOeThwbkYTT97KU75PATkgW8IhBsF1FgyPlQhyzpUX4\nrbxz93LCIlbuHQJ+K1HbSG5IrPCDWF3f5uvnFPpMSLsJ45ygUfg1t23EW3WW\nU1QpSRTOPOmq19rOfCcSrLv9+ZNyNnVYNQj71YK+LFTE3wrwuZF965c9I4pC\n1qCtHWK3OTIe3OCt7YKFQsitYMnmVARKTQ9CVVeMIygTs1ZWaSF3zLs6qsGp\nCS5D77ZWmClnHfNsKjCwR/zL6RUlea/IaQH36WVytBvsWeBFmLueAIkJi1o6\nT7IAGvA9FBETV99o9H7NE+yUHzmdv1s7QZtxCzvndd17JT45zqC8pv3itgbW\nEDXtp7PK9GWGu1V9/3YI3WkSQ6CqiduMmN11uqqa+xXLkbm1Aeu+OeOGvcCN\nMIEvRdzb1xJNbjru/ZT0Sk7H3UeyXp7uSOIwPxOSSNYKBYcmd6TlrDvq4r2M\nMAxdkxdgsq7PVXJdealBnVG5HiHinqRVn8ObwyTkQWSUtQd17B2bCLQhDh2f\nqaYS3QB0P+h97ed3MRwGXI144e8fmMDVSw+z65NeQx74CWxbGP/sykdmoiev\nTUsh\r\n=0/qV\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIArmr2iHvFwBBOfYb8aPzlzcBx4ei+/gRPScRLu2kTPmAiEAnHsmfVPPEbBVYT3fy4G4s0Y6D1cPhCN+S2p1JxfNAhA="}]},"maintainers":[{"name":"delwiv","email":"delwiv@gmail.com"},{"name":"fhou","email":"npm@bernardle.com"},{"name":"liryc","email":"cyril@oyst.com"},{"name":"nicolaschenet","email":"ironic51@gmail.com"}],"_npmUser":{"name":"delwiv","email":"delwiv@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/react-azure-adb2c_0.3.2-lcbeta14_1548414760481_0.056347042644533385"},"_hasShrinkwrap":false},"0.3.2-lcbeta15":{"name":"@yoss-org/react-azure-adb2c","version":"0.3.2-lcbeta15","description":"Authentication library for Azure AD B2C and ReactJS","main":"lib/react-azure-adb2c.js","scripts":{"compile":"cross-env NODE_ENV=production babel src --out-dir lib","prepublish":"npm run compile"},"repository":{"type":"git","url":"git+https://github.com/jamesrandall/react-azure-adb2c.git"},"keywords":["react","js","AAD","B2C","oauth","azure"],"author":{"name":"Cyril HAGEGE"},"license":"MIT","bugs":{"url":"https://github.com/JamesRandall/react-azure-adb2c/issues"},"homepage":"https://github.com/JamesRandall/react-azure-adb2c#readme","dependencies":{"msal":"^0.1.5"},"peerDependencies":{"react":"^15.0.0 || ^16.0.0"},"devDependencies":{"babel-cli":"^6.26.0","babel-core":"6.24.1","babel-eslint":"^8.0.3","babel-jest":"20.0.3","babel-loader":"7.0.0","babel-plugin-import":"^1.2.1","babel-polyfill":"^6.23.0","babel-preset-env":"^1.6.1","babel-preset-react-app":"^3.0.0","babel-runtime":"6.23.0","cross-env":"^5.1.4","eslint":"^4.12.1","eslint-config-airbnb":"^16.1.0","eslint-config-defaults":"^9.0.0","eslint-plugin-import":"^2.8.0","eslint-plugin-jsx-a11y":"^6.0.2","eslint-plugin-react":"^7.5.1","eslint-plugin-sort-imports-es6-autofix":"^0.3.0"},"readme":"# README\n\nAzure AD B2C is a cost effective identity provider covering social and enterprise logins but it can be awekward to integrate with - its documentation is currently not great and using it involves rooting around across multiple samples, the ADAL library, and the MSAL library.\n\nThat being the case I've focused this package on B2C although with minor changes it could be used more broadly. MSAL itself, which this library wraps, is rather generic but B2C has some specific requirements and I think half of the problem with the documentation is that you end up drifting across B2C and straight AD. I wanted to make things simpler for B2C.\n\nHopefully this will help people writing React apps. It makes use of MSAL underneath and the core of it (other than protecting routes) will probably work with other frameworks too but I use React at the moment. As it's an SPA my assumption in the library and documentation below is that you ultimately want to get an access token that you can use to call remote APIs. See this [Azure AD B2C post here](https://docs.microsoft.com/en-us/azure/active-directory-b2c/active-directory-b2c-access-tokens) for details on how to set this up on the B2C side.\n\nPRs welcome!\n\n## Installation\n\nIf you are using npm:\n\n    npm install react-azure-adb2c --save\n\nOr if you are using yarn:\n\n    yarn add react-azure-adb2c\n\n## Initializing the Library\n\nYou'll first need to load the module and pass some configuration to the library. Normally this would go in your index.js file:\n\n    import authentication from 'react-azure-adb2c';\n    authentication.initialize({\n        // optional, will default to this\n        instance: 'https://login.microsoftonline.com/tfp/', \n        // your B2C tenant\n        tenant: 'myb2ctenant.onmicrosoft.com',\n        // the policy to use to sign in, can also be a sign up or sign in policy\n        signInPolicy: 'mysigninpolicy',\n        // the policy to use for password reset\n        resetPolicy: 'mypasswordresetpolicy',\n        // the the B2C application you want to authenticate with (that's just a random GUID - get yours from the portal)\n        applicationId: '75ee2b43-ad2c-4366-9b8f-84b7d19d776e',\n        // where MSAL will store state - localStorage or sessionStorage\n        cacheLocation: 'sessionStorage',\n        // the scopes you want included in the access token\n        scopes: ['https://myb2ctenant.onmicrosoft.com/management/admin'],\n        // optional, the redirect URI - if not specified MSAL will pick up the location from window.href\n        redirectUri: 'http://localhost:3000',\n        // optional, the URI to redirect to after logout\n        postLogoutRedirectUri: 'http://myapp.com'\n    });\n    \n## Authenticating When The App Starts\n\nIf you want to set things up so that a user is authenticated as soon as they hit your app (for example if you've got a link to an app from a landing page) then, in index.js, wrap the lines of code that launch the React app with the _authentication.run_ function:\n\n    authentication.run(() => {\n      ReactDOM.render(<App />, document.getElementById('root'));\n      registerServiceWorker();  \n    });\n\n## Triggering Authentication Based on Components Mounting (and routing)\n\nIf you want to set things up so that a user is authenticated as they visit a part of the application that requires authentication then the appropriate components can be wrapped inside higher order components that will handle the authentication process. This is done using the _authentication.required_ function, normally in conjunction with a router. The example below shows this using the popular react-router:\n\n    import React, { Component } from 'react';\n    import authentication from 'react-azure-adb2c'\n    import { BrowserRouter as Router, Route, Switch } from \"react-router-dom\";\n    import HomePage from './Homepage'\n    import MembersArea from './MembersArea'\n    \n    class App extends Component {\n      render() {\n        return (\n          <Router basename={process.env.PUBLIC_URL}>\n            <Switch>\n              <Route exact path=\"/\" component={HomePage} />\n              <Route exact path=\"/membersArea\" component={authentication.required(MembersArea)}>\n            </Switch>\n          </Router>\n        );\n      }\n    }\n\n## Getting the Access Token\n\nSimply call the method _getAccessToken_:\n\n    import authentication from 'react-azure-adb2c'\n\n    // ...\n\n    const token = authentication.getAccessToken();\n\n## Signing Out\n\nTo sign out:\n\n    import authentication from 'react-azure-adb2c'\n\n    // ...\n\n    authentication.signOut();\n\n## Thanks\n\nTo build this I made use of the B2C site, the [MSAL library docs](https://github.com/AzureAD/microsoft-authentication-library-for-js), the [react-adal source](https://github.com/salvoravida/react-adal) and this [React MSAL sample](https://github.com/sunilbandla/react-msal-sample). Thanks!\n","readmeFilename":"README.md","gitHead":"f8c305eafae452893765d5f91171f225138fc3ac","_id":"@yoss-org/react-azure-adb2c@0.3.2-lcbeta15","_nodeVersion":"11.6.0","_npmVersion":"6.6.0","dist":{"integrity":"sha512-l4VP3JNC4J73oIMlDm9K2zH8rk01Gpzb3v1rT1mouR0xX0cmtQIF0IAAmQ5G7AJ3xqr5xtAW3VOn7OVObrgZ3Q==","shasum":"ef115d63ebb5bbdc69ae43fc2767036e530109fa","tarball":"https://registry.npmjs.org/@yoss-org/react-azure-adb2c/-/react-azure-adb2c-0.3.2-lcbeta15.tgz","fileCount":9,"unpackedSize":177825,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcSu+ECRA9TVsSAnZWagAA/8oQAIG9cqYIyquSBrtUdUXH\noLip4PWkkHM8fe7lusiP31ekFeMw8MYwRByeOqPyxIXHglEJay1efBuGCNq5\nqOI/HvFaVukRCttXlq3ElR4cOE/I8q6cyt0LKrQG48ZOnDFDrgjsdLyiYB1U\nYaeiphzu02zhlnUJ7OX7gm7AkIdqjbZVYmT+KBY8kC7IB128j/tziNTbGu70\nuZumMlMlGQOBlmLb1IW7f4sSZqop2+a+WfNHRm6SaKBrM4pdrJoT1cbqncib\n5Ge5UPPOXfmcAAPOolw5UtwTg0NBkg3aXgqZbC/qhp9Z1NQPKSRMlIw71IT1\nbfP5n8A0guv9BY0Q2CwOROUSK7QbVPp4qsQGteacCaDVy4bXNbp2OjMPLfF6\nlrJ00hNCBxC135MyJ6+5EnlkYTg//aGiR3cNwGUzwkiOA3foGEaTsPuF1O2q\n7GStyGFJeX11Ft6iEe1sDyn/M3BYMhyKhuHG4i3D8uM99DijEb6ifokMpZJ7\nWeg664F7fd7mOYcpQdY7+ke+CiK1CEKjFot9lYGRyZkDNSJdRGVbyFoWcjaT\nlxV0cCL8ITc84T+eBd1YYUo5lOF0ecHvpzCl2deANie9TFSITL3YP9Bfj7Oh\nxWmYDzcK2ugwGoRc98FICz4hIw7fLXaptOpKCf/TEI5Y2dTIPWFKYBwlJDPr\n9twp\r\n=ArhQ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBFZzqAwfCxiXUQRfre9zMNq75+cQ5xddLbM2Dk+98GoAiBdisRjS71Ge+sM4hTYDZEEVnSFLPiP0tNPYtcKUU+u9g=="}]},"maintainers":[{"name":"delwiv","email":"delwiv@gmail.com"},{"name":"fhou","email":"npm@bernardle.com"},{"name":"liryc","email":"cyril@oyst.com"},{"name":"nicolaschenet","email":"ironic51@gmail.com"}],"_npmUser":{"name":"delwiv","email":"delwiv@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/react-azure-adb2c_0.3.2-lcbeta15_1548414851451_0.7645253205140237"},"_hasShrinkwrap":false},"0.3.2-lcbeta16":{"name":"@yoss-org/react-azure-adb2c","version":"0.3.2-lcbeta16","description":"Authentication library for Azure AD B2C and ReactJS","main":"lib/react-azure-adb2c.js","scripts":{"compile":"cross-env NODE_ENV=production babel src --out-dir lib","prepublish":"npm run compile"},"repository":{"type":"git","url":"git+https://github.com/jamesrandall/react-azure-adb2c.git"},"keywords":["react","js","AAD","B2C","oauth","azure"],"author":{"name":"Cyril HAGEGE"},"license":"MIT","bugs":{"url":"https://github.com/JamesRandall/react-azure-adb2c/issues"},"homepage":"https://github.com/JamesRandall/react-azure-adb2c#readme","dependencies":{"msal":"^0.1.5"},"peerDependencies":{"react":"^15.0.0 || ^16.0.0"},"devDependencies":{"babel-cli":"^6.26.0","babel-core":"6.24.1","babel-eslint":"^8.0.3","babel-jest":"20.0.3","babel-loader":"7.0.0","babel-plugin-import":"^1.2.1","babel-polyfill":"^6.23.0","babel-preset-env":"^1.6.1","babel-preset-react-app":"^3.0.0","babel-runtime":"6.23.0","cross-env":"^5.1.4","eslint":"^4.12.1","eslint-config-airbnb":"^16.1.0","eslint-config-defaults":"^9.0.0","eslint-plugin-import":"^2.8.0","eslint-plugin-jsx-a11y":"^6.0.2","eslint-plugin-react":"^7.5.1","eslint-plugin-sort-imports-es6-autofix":"^0.3.0"},"readme":"# README\n\nAzure AD B2C is a cost effective identity provider covering social and enterprise logins but it can be awekward to integrate with - its documentation is currently not great and using it involves rooting around across multiple samples, the ADAL library, and the MSAL library.\n\nThat being the case I've focused this package on B2C although with minor changes it could be used more broadly. MSAL itself, which this library wraps, is rather generic but B2C has some specific requirements and I think half of the problem with the documentation is that you end up drifting across B2C and straight AD. I wanted to make things simpler for B2C.\n\nHopefully this will help people writing React apps. It makes use of MSAL underneath and the core of it (other than protecting routes) will probably work with other frameworks too but I use React at the moment. As it's an SPA my assumption in the library and documentation below is that you ultimately want to get an access token that you can use to call remote APIs. See this [Azure AD B2C post here](https://docs.microsoft.com/en-us/azure/active-directory-b2c/active-directory-b2c-access-tokens) for details on how to set this up on the B2C side.\n\nPRs welcome!\n\n## Installation\n\nIf you are using npm:\n\n    npm install react-azure-adb2c --save\n\nOr if you are using yarn:\n\n    yarn add react-azure-adb2c\n\n## Initializing the Library\n\nYou'll first need to load the module and pass some configuration to the library. Normally this would go in your index.js file:\n\n    import authentication from 'react-azure-adb2c';\n    authentication.initialize({\n        // optional, will default to this\n        instance: 'https://login.microsoftonline.com/tfp/', \n        // your B2C tenant\n        tenant: 'myb2ctenant.onmicrosoft.com',\n        // the policy to use to sign in, can also be a sign up or sign in policy\n        signInPolicy: 'mysigninpolicy',\n        // the policy to use for password reset\n        resetPolicy: 'mypasswordresetpolicy',\n        // the the B2C application you want to authenticate with (that's just a random GUID - get yours from the portal)\n        applicationId: '75ee2b43-ad2c-4366-9b8f-84b7d19d776e',\n        // where MSAL will store state - localStorage or sessionStorage\n        cacheLocation: 'sessionStorage',\n        // the scopes you want included in the access token\n        scopes: ['https://myb2ctenant.onmicrosoft.com/management/admin'],\n        // optional, the redirect URI - if not specified MSAL will pick up the location from window.href\n        redirectUri: 'http://localhost:3000',\n        // optional, the URI to redirect to after logout\n        postLogoutRedirectUri: 'http://myapp.com'\n    });\n    \n## Authenticating When The App Starts\n\nIf you want to set things up so that a user is authenticated as soon as they hit your app (for example if you've got a link to an app from a landing page) then, in index.js, wrap the lines of code that launch the React app with the _authentication.run_ function:\n\n    authentication.run(() => {\n      ReactDOM.render(<App />, document.getElementById('root'));\n      registerServiceWorker();  \n    });\n\n## Triggering Authentication Based on Components Mounting (and routing)\n\nIf you want to set things up so that a user is authenticated as they visit a part of the application that requires authentication then the appropriate components can be wrapped inside higher order components that will handle the authentication process. This is done using the _authentication.required_ function, normally in conjunction with a router. The example below shows this using the popular react-router:\n\n    import React, { Component } from 'react';\n    import authentication from 'react-azure-adb2c'\n    import { BrowserRouter as Router, Route, Switch } from \"react-router-dom\";\n    import HomePage from './Homepage'\n    import MembersArea from './MembersArea'\n    \n    class App extends Component {\n      render() {\n        return (\n          <Router basename={process.env.PUBLIC_URL}>\n            <Switch>\n              <Route exact path=\"/\" component={HomePage} />\n              <Route exact path=\"/membersArea\" component={authentication.required(MembersArea)}>\n            </Switch>\n          </Router>\n        );\n      }\n    }\n\n## Getting the Access Token\n\nSimply call the method _getAccessToken_:\n\n    import authentication from 'react-azure-adb2c'\n\n    // ...\n\n    const token = authentication.getAccessToken();\n\n## Signing Out\n\nTo sign out:\n\n    import authentication from 'react-azure-adb2c'\n\n    // ...\n\n    authentication.signOut();\n\n## Thanks\n\nTo build this I made use of the B2C site, the [MSAL library docs](https://github.com/AzureAD/microsoft-authentication-library-for-js), the [react-adal source](https://github.com/salvoravida/react-adal) and this [React MSAL sample](https://github.com/sunilbandla/react-msal-sample). Thanks!\n","readmeFilename":"README.md","gitHead":"f8c305eafae452893765d5f91171f225138fc3ac","_id":"@yoss-org/react-azure-adb2c@0.3.2-lcbeta16","_nodeVersion":"11.6.0","_npmVersion":"6.6.0","dist":{"integrity":"sha512-ZLWzTpe/fJSDzETQdRjzfyLaWHN6kUfsuR9NmxdevlEYKm9oMtWKv3wnA7JZ2c/lxmptGX0PWOQtMA+LkdQLAQ==","shasum":"27e8c4e2537548ddb88109e2b60e6c8b586d84e8","tarball":"https://registry.npmjs.org/@yoss-org/react-azure-adb2c/-/react-azure-adb2c-0.3.2-lcbeta16.tgz","fileCount":9,"unpackedSize":177828,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcSxhNCRA9TVsSAnZWagAAbjIP/2xO9/TwLTx+feJfMdp3\nIyvKE3W8FVtX46uO0svRSTXM199XzOBfPJ4GHvo8kt6BrSFEa3KLnn7yTCSG\nFv6BaUphLKw4Tqx8BcEnbvVAKTR8J1ucKqc+zNxXDQwx7KtT1c6KFYNh+wDR\n6KPtFijS8783Gkzo/f7xV9nnpMHU3nLdSa50247Q6OhwNtJJRBuKbU9KqUyS\n5wuqqXOmpfNB34hJai62mZrHEDdMNbeXopz1CrP9pZPcCeRCeHO7ZICEemQz\nNifgd/Penk9E7kIo7BihYZdHbl6W+w72bxpJxg6ynCFU9FWMCs/gi4ftkE53\nnhrOs34xZH1reZ+8XIfC3JJGCzc6IKSK8Oxzsro7BwrDrB2FQDTagsIzYk1q\nvV1edQYdD8Bb9C1jHmTXr2XM7t1uh07KAVT/InXPWB9oP5hWKSK/wWsxSxcT\njK1chBv0VVBY02RbcCr5vkOSE1J98bnRIhjClBc4iugqMzVqv2Ar86WERAFR\nD0PtEfyjE9bEBRNzw3fzTOfWnh0vAui0DJMilK9120fCNk2tQ3NCnu5Jhp90\nLrndhSLZ4ssZqklFCRItGgKnVJZ10VEuRs0G4cE2GpwNI4dg/kYiP7JfkY+G\nNrhUBLYRSxbK2vT37bX0on0ibV3vLpT4+UyHyEK2v0ZViE0nOdEB0QhAwGzg\nqc9t\r\n=6vJy\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIC7+agncIpGtORjysfRR92oPc4Th1GZB9JnJuRelXcTtAiEAmhilaFd25akFpck3+MIqAjBuCjAEFuPcDX8lDOqllps="}]},"maintainers":[{"name":"delwiv","email":"delwiv@gmail.com"},{"name":"fhou","email":"npm@bernardle.com"},{"name":"liryc","email":"cyril@oyst.com"},{"name":"nicolaschenet","email":"ironic51@gmail.com"}],"_npmUser":{"name":"delwiv","email":"delwiv@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/react-azure-adb2c_0.3.2-lcbeta16_1548425293201_0.11145445106048668"},"_hasShrinkwrap":false},"0.3.2-lcbeta17":{"name":"@yoss-org/react-azure-adb2c","version":"0.3.2-lcbeta17","description":"Authentication library for Azure AD B2C and ReactJS","main":"lib/react-azure-adb2c.js","scripts":{"compile":"cross-env NODE_ENV=production babel src --out-dir lib","prepublish":"npm run compile"},"repository":{"type":"git","url":"git+https://github.com/jamesrandall/react-azure-adb2c.git"},"keywords":["react","js","AAD","B2C","oauth","azure"],"author":{"name":"Cyril HAGEGE"},"license":"MIT","bugs":{"url":"https://github.com/JamesRandall/react-azure-adb2c/issues"},"homepage":"https://github.com/JamesRandall/react-azure-adb2c#readme","dependencies":{"msal":"^0.1.5"},"peerDependencies":{"react":"^15.0.0 || ^16.0.0"},"devDependencies":{"babel-cli":"^6.26.0","babel-core":"6.24.1","babel-eslint":"^8.0.3","babel-jest":"20.0.3","babel-loader":"7.0.0","babel-plugin-import":"^1.2.1","babel-polyfill":"^6.23.0","babel-preset-env":"^1.6.1","babel-preset-react-app":"^3.0.0","babel-runtime":"6.23.0","cross-env":"^5.1.4","eslint":"^4.12.1","eslint-config-airbnb":"^16.1.0","eslint-config-defaults":"^9.0.0","eslint-plugin-import":"^2.8.0","eslint-plugin-jsx-a11y":"^6.0.2","eslint-plugin-react":"^7.5.1","eslint-plugin-sort-imports-es6-autofix":"^0.3.0"},"readme":"# README\n\nAzure AD B2C is a cost effective identity provider covering social and enterprise logins but it can be awekward to integrate with - its documentation is currently not great and using it involves rooting around across multiple samples, the ADAL library, and the MSAL library.\n\nThat being the case I've focused this package on B2C although with minor changes it could be used more broadly. MSAL itself, which this library wraps, is rather generic but B2C has some specific requirements and I think half of the problem with the documentation is that you end up drifting across B2C and straight AD. I wanted to make things simpler for B2C.\n\nHopefully this will help people writing React apps. It makes use of MSAL underneath and the core of it (other than protecting routes) will probably work with other frameworks too but I use React at the moment. As it's an SPA my assumption in the library and documentation below is that you ultimately want to get an access token that you can use to call remote APIs. See this [Azure AD B2C post here](https://docs.microsoft.com/en-us/azure/active-directory-b2c/active-directory-b2c-access-tokens) for details on how to set this up on the B2C side.\n\nPRs welcome!\n\n## Installation\n\nIf you are using npm:\n\n    npm install react-azure-adb2c --save\n\nOr if you are using yarn:\n\n    yarn add react-azure-adb2c\n\n## Initializing the Library\n\nYou'll first need to load the module and pass some configuration to the library. Normally this would go in your index.js file:\n\n    import authentication from 'react-azure-adb2c';\n    authentication.initialize({\n        // optional, will default to this\n        instance: 'https://login.microsoftonline.com/tfp/', \n        // your B2C tenant\n        tenant: 'myb2ctenant.onmicrosoft.com',\n        // the policy to use to sign in, can also be a sign up or sign in policy\n        signInPolicy: 'mysigninpolicy',\n        // the policy to use for password reset\n        resetPolicy: 'mypasswordresetpolicy',\n        // the the B2C application you want to authenticate with (that's just a random GUID - get yours from the portal)\n        applicationId: '75ee2b43-ad2c-4366-9b8f-84b7d19d776e',\n        // where MSAL will store state - localStorage or sessionStorage\n        cacheLocation: 'sessionStorage',\n        // the scopes you want included in the access token\n        scopes: ['https://myb2ctenant.onmicrosoft.com/management/admin'],\n        // optional, the redirect URI - if not specified MSAL will pick up the location from window.href\n        redirectUri: 'http://localhost:3000',\n        // optional, the URI to redirect to after logout\n        postLogoutRedirectUri: 'http://myapp.com'\n    });\n    \n## Authenticating When The App Starts\n\nIf you want to set things up so that a user is authenticated as soon as they hit your app (for example if you've got a link to an app from a landing page) then, in index.js, wrap the lines of code that launch the React app with the _authentication.run_ function:\n\n    authentication.run(() => {\n      ReactDOM.render(<App />, document.getElementById('root'));\n      registerServiceWorker();  \n    });\n\n## Triggering Authentication Based on Components Mounting (and routing)\n\nIf you want to set things up so that a user is authenticated as they visit a part of the application that requires authentication then the appropriate components can be wrapped inside higher order components that will handle the authentication process. This is done using the _authentication.required_ function, normally in conjunction with a router. The example below shows this using the popular react-router:\n\n    import React, { Component } from 'react';\n    import authentication from 'react-azure-adb2c'\n    import { BrowserRouter as Router, Route, Switch } from \"react-router-dom\";\n    import HomePage from './Homepage'\n    import MembersArea from './MembersArea'\n    \n    class App extends Component {\n      render() {\n        return (\n          <Router basename={process.env.PUBLIC_URL}>\n            <Switch>\n              <Route exact path=\"/\" component={HomePage} />\n              <Route exact path=\"/membersArea\" component={authentication.required(MembersArea)}>\n            </Switch>\n          </Router>\n        );\n      }\n    }\n\n## Getting the Access Token\n\nSimply call the method _getAccessToken_:\n\n    import authentication from 'react-azure-adb2c'\n\n    // ...\n\n    const token = authentication.getAccessToken();\n\n## Signing Out\n\nTo sign out:\n\n    import authentication from 'react-azure-adb2c'\n\n    // ...\n\n    authentication.signOut();\n\n## Thanks\n\nTo build this I made use of the B2C site, the [MSAL library docs](https://github.com/AzureAD/microsoft-authentication-library-for-js), the [react-adal source](https://github.com/salvoravida/react-adal) and this [React MSAL sample](https://github.com/sunilbandla/react-msal-sample). Thanks!\n","readmeFilename":"README.md","gitHead":"d076205a10b2645ce1f04a5d5f3240e3d4330696","_id":"@yoss-org/react-azure-adb2c@0.3.2-lcbeta17","_nodeVersion":"11.6.0","_npmVersion":"6.6.0","dist":{"integrity":"sha512-LY5cQlMt6Qv2ZxF7koCS/48rrooZronPSSsD//+VTAedamwYex1yzqpbAgG0nhh8iKIjgV+RXTqLFwLXhzg7xQ==","shasum":"124718202a733933945fde4f0520557ad35bad23","tarball":"https://registry.npmjs.org/@yoss-org/react-azure-adb2c/-/react-azure-adb2c-0.3.2-lcbeta17.tgz","fileCount":9,"unpackedSize":178456,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcSyJfCRA9TVsSAnZWagAAiV4QAJRwLFnFZfnD2DJc6cY1\nAdEKLRCDi/gwzZ7Hvn9ClL/yqQs2NykSMydxLk/NPHIcjqX/Vp2FTi1BF3Th\n+cMEh+bgl+uNrwZLIN9v/OkaMFrIXFjO9tigICf004wJUo1zDLmzyFpR9WDb\nMwGoYhgQGzwxHfQ0ddvkHb04O6svZ0VXZKVFFah7R+29+fWaSP5sh6h9Be0I\nn9Ey6JOfA2K09wU3kAa+ZCP9ohBMm+vG8trKaKkbZjsr4qmcgZT+ey9Niqy+\nd6mTTnoIj90cyFXlH1/wrY53Y+cGEb+wAN2V/bz2EvLJacghyQJgqPqnvzIa\noc1lGFJNsFmVXys7abpxSqFF2ZI/axhZ0j83tTK7+OrT//NPl6S3vbK/BO6M\nUwjDO212UjmKS3aK4GAve2JBg9axFr8vzTIQUMJxa5pBBP50sHnB2vbAeY3O\n5Sq5UEP2dGPCY4nSM7jpfRglQKfRfu/LLmRXp5rExy1Ib9qnGJfhRYIu4pO2\nPZmYptQF4k08XOHkDihET+QEcJxFPo+1XK8UkGSfsnGXULoDwOQ/ue6UAR/f\nS6GwYCBe4Zn/3bgWlw2fkSH81Fu6//PtXbgvciNJ7Ly8QX0+idevU6GkIg9Y\nCTlyaX4epS10Yqg43FtbmC4HkhP3Qs09VuC1sOtqYLvzk9u5qm2fMeS9fScu\nrgUa\r\n=vJIG\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIG9FwXV3444hfQc792AxNITNwidRdwkt1XynERjzjUKZAiEA71KBFWShuOsswS9e4XRZWxYmzRProFARTBe2H7WDN3k="}]},"maintainers":[{"name":"delwiv","email":"delwiv@gmail.com"},{"name":"fhou","email":"npm@bernardle.com"},{"name":"liryc","email":"cyril@oyst.com"},{"name":"nicolaschenet","email":"ironic51@gmail.com"}],"_npmUser":{"name":"delwiv","email":"delwiv@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/react-azure-adb2c_0.3.2-lcbeta17_1548427870648_0.4334033073331389"},"_hasShrinkwrap":false},"0.3.2-lcbeta18":{"name":"@yoss-org/react-azure-adb2c","version":"0.3.2-lcbeta18","description":"Authentication library for Azure AD B2C and ReactJS","main":"lib/react-azure-adb2c.js","scripts":{"compile":"cross-env NODE_ENV=production babel src --out-dir lib","prepublish":"npm run compile"},"repository":{"type":"git","url":"git+https://github.com/jamesrandall/react-azure-adb2c.git"},"keywords":["react","js","AAD","B2C","oauth","azure"],"author":{"name":"Cyril HAGEGE"},"license":"MIT","bugs":{"url":"https://github.com/JamesRandall/react-azure-adb2c/issues"},"homepage":"https://github.com/JamesRandall/react-azure-adb2c#readme","dependencies":{"msal":"^0.1.5"},"peerDependencies":{"react":"^15.0.0 || ^16.0.0"},"devDependencies":{"babel-cli":"^6.26.0","babel-core":"6.24.1","babel-eslint":"^8.0.3","babel-jest":"20.0.3","babel-loader":"7.0.0","babel-plugin-import":"^1.2.1","babel-polyfill":"^6.23.0","babel-preset-env":"^1.6.1","babel-preset-react-app":"^3.0.0","babel-runtime":"6.23.0","cross-env":"^5.1.4","eslint":"^4.12.1","eslint-config-airbnb":"^16.1.0","eslint-config-defaults":"^9.0.0","eslint-plugin-import":"^2.8.0","eslint-plugin-jsx-a11y":"^6.0.2","eslint-plugin-react":"^7.5.1","eslint-plugin-sort-imports-es6-autofix":"^0.3.0"},"readme":"# README\n\nAzure AD B2C is a cost effective identity provider covering social and enterprise logins but it can be awekward to integrate with - its documentation is currently not great and using it involves rooting around across multiple samples, the ADAL library, and the MSAL library.\n\nThat being the case I've focused this package on B2C although with minor changes it could be used more broadly. MSAL itself, which this library wraps, is rather generic but B2C has some specific requirements and I think half of the problem with the documentation is that you end up drifting across B2C and straight AD. I wanted to make things simpler for B2C.\n\nHopefully this will help people writing React apps. It makes use of MSAL underneath and the core of it (other than protecting routes) will probably work with other frameworks too but I use React at the moment. As it's an SPA my assumption in the library and documentation below is that you ultimately want to get an access token that you can use to call remote APIs. See this [Azure AD B2C post here](https://docs.microsoft.com/en-us/azure/active-directory-b2c/active-directory-b2c-access-tokens) for details on how to set this up on the B2C side.\n\nPRs welcome!\n\n## Installation\n\nIf you are using npm:\n\n    npm install react-azure-adb2c --save\n\nOr if you are using yarn:\n\n    yarn add react-azure-adb2c\n\n## Initializing the Library\n\nYou'll first need to load the module and pass some configuration to the library. Normally this would go in your index.js file:\n\n    import authentication from 'react-azure-adb2c';\n    authentication.initialize({\n        // optional, will default to this\n        instance: 'https://login.microsoftonline.com/tfp/', \n        // your B2C tenant\n        tenant: 'myb2ctenant.onmicrosoft.com',\n        // the policy to use to sign in, can also be a sign up or sign in policy\n        signInPolicy: 'mysigninpolicy',\n        // the policy to use for password reset\n        resetPolicy: 'mypasswordresetpolicy',\n        // the the B2C application you want to authenticate with (that's just a random GUID - get yours from the portal)\n        applicationId: '75ee2b43-ad2c-4366-9b8f-84b7d19d776e',\n        // where MSAL will store state - localStorage or sessionStorage\n        cacheLocation: 'sessionStorage',\n        // the scopes you want included in the access token\n        scopes: ['https://myb2ctenant.onmicrosoft.com/management/admin'],\n        // optional, the redirect URI - if not specified MSAL will pick up the location from window.href\n        redirectUri: 'http://localhost:3000',\n        // optional, the URI to redirect to after logout\n        postLogoutRedirectUri: 'http://myapp.com'\n    });\n    \n## Authenticating When The App Starts\n\nIf you want to set things up so that a user is authenticated as soon as they hit your app (for example if you've got a link to an app from a landing page) then, in index.js, wrap the lines of code that launch the React app with the _authentication.run_ function:\n\n    authentication.run(() => {\n      ReactDOM.render(<App />, document.getElementById('root'));\n      registerServiceWorker();  \n    });\n\n## Triggering Authentication Based on Components Mounting (and routing)\n\nIf you want to set things up so that a user is authenticated as they visit a part of the application that requires authentication then the appropriate components can be wrapped inside higher order components that will handle the authentication process. This is done using the _authentication.required_ function, normally in conjunction with a router. The example below shows this using the popular react-router:\n\n    import React, { Component } from 'react';\n    import authentication from 'react-azure-adb2c'\n    import { BrowserRouter as Router, Route, Switch } from \"react-router-dom\";\n    import HomePage from './Homepage'\n    import MembersArea from './MembersArea'\n    \n    class App extends Component {\n      render() {\n        return (\n          <Router basename={process.env.PUBLIC_URL}>\n            <Switch>\n              <Route exact path=\"/\" component={HomePage} />\n              <Route exact path=\"/membersArea\" component={authentication.required(MembersArea)}>\n            </Switch>\n          </Router>\n        );\n      }\n    }\n\n## Getting the Access Token\n\nSimply call the method _getAccessToken_:\n\n    import authentication from 'react-azure-adb2c'\n\n    // ...\n\n    const token = authentication.getAccessToken();\n\n## Signing Out\n\nTo sign out:\n\n    import authentication from 'react-azure-adb2c'\n\n    // ...\n\n    authentication.signOut();\n\n## Thanks\n\nTo build this I made use of the B2C site, the [MSAL library docs](https://github.com/AzureAD/microsoft-authentication-library-for-js), the [react-adal source](https://github.com/salvoravida/react-adal) and this [React MSAL sample](https://github.com/sunilbandla/react-msal-sample). Thanks!\n","readmeFilename":"README.md","gitHead":"a6dce543da567f429aafa8c263917d98a79b22e1","_id":"@yoss-org/react-azure-adb2c@0.3.2-lcbeta18","_nodeVersion":"11.6.0","_npmVersion":"6.6.0","dist":{"integrity":"sha512-M2Tp2S4oyhI4zf0urSBqFkhvZ+S8X40HW/ICcNsbRId/kg+PbSbuB+CCnu12BrtSnFMCepmQDhNXJtHd3JBHug==","shasum":"b17e16da2a60acdcdf579865c1cea4f43efeada3","tarball":"https://registry.npmjs.org/@yoss-org/react-azure-adb2c/-/react-azure-adb2c-0.3.2-lcbeta18.tgz","fileCount":10,"unpackedSize":178903,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcSydeCRA9TVsSAnZWagAArKIP/A4/egpVUuV3iJUhI9GT\na4kDm/0RVy3TGj7b0zxyMn0JqPigcEdP0N694ZWKvZo7N2CQG9msDZjbDbUG\n6MQw/XrO+wCuB/Hg2k/3pujVPI1Ks9WUHr1HS1YNQSyy88VeEMhx7+oHVMpK\ncbDvwXCRlumJCE16MZCxIFRMpgufdji8AIKU1nXR2Kz9s9H/ZS7JBv6RkUXm\nM01vOZoNP1LF3slAtmDGMbPC07Eq/k+nl3DovRHfbM/Sc0JZR6ceUpTKv2by\np+hnKNT+e6jaRxF6RFchEqOcd3PPjyG0oBSIxpwAO/52U9INibwmKt2MIAuW\nJLvYz/TPHJ2JPPeJ31Hc1kBlN9c+co425EoVE+WXKR9ty0ytZCxykXufZuYJ\nu0HmZBECDUglC07klfM53VJr3/eHbORnE0G1v5xSm0ql5m/xP3nADId5gkXg\ntbEHPjUFnvG7BBO4YefxwqTyEIzG2JHD4n2DT5IKD0gCEe5dfhbGwGSQ0hlJ\n0oBvTog7NA8DCu7ffK9WZmd/UR/nIvbIUZSC5gQsGTKQlvK8+JK/00Jd2e5F\nz02WnctuFehSByrHWZbYFiLQ2BVz/ibBqRDCdiFawO7SrU3sKBqhFvkNZJWd\nFzzmMgPo/fFdQkvdbn1Y9kN/AyuO3nV9JZkwugWPOurdV+d+ZFx3oQNUgqfP\nMWe5\r\n=z1/I\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCNaqXBJIBxHu58N7gjNwGRZsFSNE+jDIwnltQuCsuFzQIgFpIsqryza5G8mjbPuge39sY1UmClXVxYBOxSCt8bgXo="}]},"maintainers":[{"name":"delwiv","email":"delwiv@gmail.com"},{"name":"fhou","email":"npm@bernardle.com"},{"name":"liryc","email":"cyril@oyst.com"},{"name":"nicolaschenet","email":"ironic51@gmail.com"}],"_npmUser":{"name":"delwiv","email":"delwiv@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/react-azure-adb2c_0.3.2-lcbeta18_1548429149621_0.2057467380700091"},"_hasShrinkwrap":false},"0.3.2-lcbeta19":{"name":"@yoss-org/react-azure-adb2c","version":"0.3.2-lcbeta19","description":"Authentication library for Azure AD B2C and ReactJS","main":"lib/react-azure-adb2c.js","scripts":{"compile":"cross-env NODE_ENV=production babel src --out-dir lib","prepublish":"npm run compile"},"repository":{"type":"git","url":"git+https://github.com/jamesrandall/react-azure-adb2c.git"},"keywords":["react","js","AAD","B2C","oauth","azure"],"author":{"name":"Cyril HAGEGE"},"license":"MIT","bugs":{"url":"https://github.com/JamesRandall/react-azure-adb2c/issues"},"homepage":"https://github.com/JamesRandall/react-azure-adb2c#readme","dependencies":{"msal":"^0.1.5"},"peerDependencies":{"react":"^15.0.0 || ^16.0.0"},"devDependencies":{"babel-cli":"^6.26.0","babel-core":"6.24.1","babel-eslint":"^8.0.3","babel-jest":"20.0.3","babel-loader":"7.0.0","babel-plugin-import":"^1.2.1","babel-polyfill":"^6.23.0","babel-preset-env":"^1.6.1","babel-preset-react-app":"^3.0.0","babel-runtime":"6.23.0","cross-env":"^5.1.4","eslint":"^4.12.1","eslint-config-airbnb":"^16.1.0","eslint-config-defaults":"^9.0.0","eslint-plugin-import":"^2.8.0","eslint-plugin-jsx-a11y":"^6.0.2","eslint-plugin-react":"^7.5.1","eslint-plugin-sort-imports-es6-autofix":"^0.3.0"},"readme":"# README\n\nAzure AD B2C is a cost effective identity provider covering social and enterprise logins but it can be awekward to integrate with - its documentation is currently not great and using it involves rooting around across multiple samples, the ADAL library, and the MSAL library.\n\nThat being the case I've focused this package on B2C although with minor changes it could be used more broadly. MSAL itself, which this library wraps, is rather generic but B2C has some specific requirements and I think half of the problem with the documentation is that you end up drifting across B2C and straight AD. I wanted to make things simpler for B2C.\n\nHopefully this will help people writing React apps. It makes use of MSAL underneath and the core of it (other than protecting routes) will probably work with other frameworks too but I use React at the moment. As it's an SPA my assumption in the library and documentation below is that you ultimately want to get an access token that you can use to call remote APIs. See this [Azure AD B2C post here](https://docs.microsoft.com/en-us/azure/active-directory-b2c/active-directory-b2c-access-tokens) for details on how to set this up on the B2C side.\n\nPRs welcome!\n\n## Installation\n\nIf you are using npm:\n\n    npm install react-azure-adb2c --save\n\nOr if you are using yarn:\n\n    yarn add react-azure-adb2c\n\n## Initializing the Library\n\nYou'll first need to load the module and pass some configuration to the library. Normally this would go in your index.js file:\n\n    import authentication from 'react-azure-adb2c';\n    authentication.initialize({\n        // optional, will default to this\n        instance: 'https://login.microsoftonline.com/tfp/', \n        // your B2C tenant\n        tenant: 'myb2ctenant.onmicrosoft.com',\n        // the policy to use to sign in, can also be a sign up or sign in policy\n        signInPolicy: 'mysigninpolicy',\n        // the policy to use for password reset\n        resetPolicy: 'mypasswordresetpolicy',\n        // the the B2C application you want to authenticate with (that's just a random GUID - get yours from the portal)\n        applicationId: '75ee2b43-ad2c-4366-9b8f-84b7d19d776e',\n        // where MSAL will store state - localStorage or sessionStorage\n        cacheLocation: 'sessionStorage',\n        // the scopes you want included in the access token\n        scopes: ['https://myb2ctenant.onmicrosoft.com/management/admin'],\n        // optional, the redirect URI - if not specified MSAL will pick up the location from window.href\n        redirectUri: 'http://localhost:3000',\n        // optional, the URI to redirect to after logout\n        postLogoutRedirectUri: 'http://myapp.com'\n    });\n    \n## Authenticating When The App Starts\n\nIf you want to set things up so that a user is authenticated as soon as they hit your app (for example if you've got a link to an app from a landing page) then, in index.js, wrap the lines of code that launch the React app with the _authentication.run_ function:\n\n    authentication.run(() => {\n      ReactDOM.render(<App />, document.getElementById('root'));\n      registerServiceWorker();  \n    });\n\n## Triggering Authentication Based on Components Mounting (and routing)\n\nIf you want to set things up so that a user is authenticated as they visit a part of the application that requires authentication then the appropriate components can be wrapped inside higher order components that will handle the authentication process. This is done using the _authentication.required_ function, normally in conjunction with a router. The example below shows this using the popular react-router:\n\n    import React, { Component } from 'react';\n    import authentication from 'react-azure-adb2c'\n    import { BrowserRouter as Router, Route, Switch } from \"react-router-dom\";\n    import HomePage from './Homepage'\n    import MembersArea from './MembersArea'\n    \n    class App extends Component {\n      render() {\n        return (\n          <Router basename={process.env.PUBLIC_URL}>\n            <Switch>\n              <Route exact path=\"/\" component={HomePage} />\n              <Route exact path=\"/membersArea\" component={authentication.required(MembersArea)}>\n            </Switch>\n          </Router>\n        );\n      }\n    }\n\n## Getting the Access Token\n\nSimply call the method _getAccessToken_:\n\n    import authentication from 'react-azure-adb2c'\n\n    // ...\n\n    const token = authentication.getAccessToken();\n\n## Signing Out\n\nTo sign out:\n\n    import authentication from 'react-azure-adb2c'\n\n    // ...\n\n    authentication.signOut();\n\n## Thanks\n\nTo build this I made use of the B2C site, the [MSAL library docs](https://github.com/AzureAD/microsoft-authentication-library-for-js), the [react-adal source](https://github.com/salvoravida/react-adal) and this [React MSAL sample](https://github.com/sunilbandla/react-msal-sample). Thanks!\n","readmeFilename":"README.md","gitHead":"a6dce543da567f429aafa8c263917d98a79b22e1","_id":"@yoss-org/react-azure-adb2c@0.3.2-lcbeta19","_nodeVersion":"11.6.0","_npmVersion":"6.6.0","dist":{"integrity":"sha512-cpVBTrR9F+HVdnB011nkXLyP4gbhl1ZA8dsr/hNZTV+cuOY4xGx1EZnmsQ59PugSADZ18N/X0s/msxgOtf+OHw==","shasum":"fb0df0358c658c3d5782cc3983c17b39dee264d7","tarball":"https://registry.npmjs.org/@yoss-org/react-azure-adb2c/-/react-azure-adb2c-0.3.2-lcbeta19.tgz","fileCount":10,"unpackedSize":178939,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcS1vUCRA9TVsSAnZWagAAXVkP/2xpNplsicVp9A4aqEHI\ni4qhahATiFSVpD3PLHX78i4VImCM1AKuRczwe2SOQ59fBCQWFkkDWD3RBtLH\njWrYcT0VUnv0Fi3Ta9dC0/mamgTj8jSHHvGvRoAcFHsu3S3JLqV1+cqyQt9w\nm13kRiMeXTjl+9FXr5ibFfzdOQb2RWEuHo3EU/Uwk4dxEtFp8MxxAW8zuMTB\nF7A7KYgQKd8TWdEZxG+27bFj7am3oIh0mCI6Vcwb2NKN899cvrgx9sI94TnF\nxggsECFho0nTyttE5atXGC+t16t1NkKnhMxJ/7Y8JIj+/IIx0R6GnBfwilBi\nq9UXBYSJxjLSR4kWoTYs+4sKXPTLx8QxOTFB4qnkOJ1oAhBKaNFFoLkYlfo8\nlhnvOrgfqnJ0qHzMaQwi6vLAkcU1Glnykgeh6PcynjudIWbeO4M/FYA2xW//\neRupvZxsOJQYqyMWm5cYp6ijpkO6v3ymZrNYS6Y65e7pFQephohg2opCstKw\nGM2W9ZG0gKDAtMvOEjn2tD2qCb58bAtMTfKcG2PgOm4NYtPazaMlXylUs733\n0NpGDXVBclIgT4UgkWH9P6yCwC533VFmufTD4zTV94/Dt2mgSoE1TYcCRC/V\nYr4ufTXjLkvRfz7+DeFRVgPqWbVO0KFJ5oJP1KibM8ILJt1UxOA4yN5sKuib\nTY3I\r\n=A1lo\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCmiH+63EBy+OQijHUWZg9de+ozmTpDTQ9W8egLa79MQAIhAPtGFIWEhkZo834oQg0aDT9c3p48bezvUQOUgWikAJf1"}]},"maintainers":[{"name":"delwiv","email":"delwiv@gmail.com"},{"name":"fhou","email":"npm@bernardle.com"},{"name":"liryc","email":"cyril@oyst.com"},{"name":"nicolaschenet","email":"ironic51@gmail.com"}],"_npmUser":{"name":"delwiv","email":"delwiv@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/react-azure-adb2c_0.3.2-lcbeta19_1548442580087_0.8553671055148784"},"_hasShrinkwrap":false},"0.3.2-lcbeta20":{"name":"@yoss-org/react-azure-adb2c","version":"0.3.2-lcbeta20","description":"Authentication library for Azure AD B2C and ReactJS","main":"lib/react-azure-adb2c.js","scripts":{"compile":"cross-env NODE_ENV=production babel src --out-dir lib","prepublish":"npm run compile"},"repository":{"type":"git","url":"git+https://github.com/jamesrandall/react-azure-adb2c.git"},"keywords":["react","js","AAD","B2C","oauth","azure"],"author":{"name":"Cyril HAGEGE"},"license":"MIT","bugs":{"url":"https://github.com/JamesRandall/react-azure-adb2c/issues"},"homepage":"https://github.com/JamesRandall/react-azure-adb2c#readme","dependencies":{"msal":"^0.1.5"},"peerDependencies":{"react":"^15.0.0 || ^16.0.0"},"devDependencies":{"babel-cli":"^6.26.0","babel-core":"6.24.1","babel-eslint":"^8.0.3","babel-jest":"20.0.3","babel-loader":"7.0.0","babel-plugin-import":"^1.2.1","babel-polyfill":"^6.23.0","babel-preset-env":"^1.6.1","babel-preset-react-app":"^3.0.0","babel-runtime":"6.23.0","cross-env":"^5.1.4","eslint":"^4.12.1","eslint-config-airbnb":"^16.1.0","eslint-config-defaults":"^9.0.0","eslint-plugin-import":"^2.8.0","eslint-plugin-jsx-a11y":"^6.0.2","eslint-plugin-react":"^7.5.1","eslint-plugin-sort-imports-es6-autofix":"^0.3.0"},"readme":"# README\n\nAzure AD B2C is a cost effective identity provider covering social and enterprise logins but it can be awekward to integrate with - its documentation is currently not great and using it involves rooting around across multiple samples, the ADAL library, and the MSAL library.\n\nThat being the case I've focused this package on B2C although with minor changes it could be used more broadly. MSAL itself, which this library wraps, is rather generic but B2C has some specific requirements and I think half of the problem with the documentation is that you end up drifting across B2C and straight AD. I wanted to make things simpler for B2C.\n\nHopefully this will help people writing React apps. It makes use of MSAL underneath and the core of it (other than protecting routes) will probably work with other frameworks too but I use React at the moment. As it's an SPA my assumption in the library and documentation below is that you ultimately want to get an access token that you can use to call remote APIs. See this [Azure AD B2C post here](https://docs.microsoft.com/en-us/azure/active-directory-b2c/active-directory-b2c-access-tokens) for details on how to set this up on the B2C side.\n\nPRs welcome!\n\n## Installation\n\nIf you are using npm:\n\n    npm install react-azure-adb2c --save\n\nOr if you are using yarn:\n\n    yarn add react-azure-adb2c\n\n## Initializing the Library\n\nYou'll first need to load the module and pass some configuration to the library. Normally this would go in your index.js file:\n\n    import authentication from 'react-azure-adb2c';\n    authentication.initialize({\n        // optional, will default to this\n        instance: 'https://login.microsoftonline.com/tfp/', \n        // your B2C tenant\n        tenant: 'myb2ctenant.onmicrosoft.com',\n        // the policy to use to sign in, can also be a sign up or sign in policy\n        signInPolicy: 'mysigninpolicy',\n        // the policy to use for password reset\n        resetPolicy: 'mypasswordresetpolicy',\n        // the the B2C application you want to authenticate with (that's just a random GUID - get yours from the portal)\n        applicationId: '75ee2b43-ad2c-4366-9b8f-84b7d19d776e',\n        // where MSAL will store state - localStorage or sessionStorage\n        cacheLocation: 'sessionStorage',\n        // the scopes you want included in the access token\n        scopes: ['https://myb2ctenant.onmicrosoft.com/management/admin'],\n        // optional, the redirect URI - if not specified MSAL will pick up the location from window.href\n        redirectUri: 'http://localhost:3000',\n        // optional, the URI to redirect to after logout\n        postLogoutRedirectUri: 'http://myapp.com'\n    });\n    \n## Authenticating When The App Starts\n\nIf you want to set things up so that a user is authenticated as soon as they hit your app (for example if you've got a link to an app from a landing page) then, in index.js, wrap the lines of code that launch the React app with the _authentication.run_ function:\n\n    authentication.run(() => {\n      ReactDOM.render(<App />, document.getElementById('root'));\n      registerServiceWorker();  \n    });\n\n## Triggering Authentication Based on Components Mounting (and routing)\n\nIf you want to set things up so that a user is authenticated as they visit a part of the application that requires authentication then the appropriate components can be wrapped inside higher order components that will handle the authentication process. This is done using the _authentication.required_ function, normally in conjunction with a router. The example below shows this using the popular react-router:\n\n    import React, { Component } from 'react';\n    import authentication from 'react-azure-adb2c'\n    import { BrowserRouter as Router, Route, Switch } from \"react-router-dom\";\n    import HomePage from './Homepage'\n    import MembersArea from './MembersArea'\n    \n    class App extends Component {\n      render() {\n        return (\n          <Router basename={process.env.PUBLIC_URL}>\n            <Switch>\n              <Route exact path=\"/\" component={HomePage} />\n              <Route exact path=\"/membersArea\" component={authentication.required(MembersArea)}>\n            </Switch>\n          </Router>\n        );\n      }\n    }\n\n## Getting the Access Token\n\nSimply call the method _getAccessToken_:\n\n    import authentication from 'react-azure-adb2c'\n\n    // ...\n\n    const token = authentication.getAccessToken();\n\n## Signing Out\n\nTo sign out:\n\n    import authentication from 'react-azure-adb2c'\n\n    // ...\n\n    authentication.signOut();\n\n## Thanks\n\nTo build this I made use of the B2C site, the [MSAL library docs](https://github.com/AzureAD/microsoft-authentication-library-for-js), the [react-adal source](https://github.com/salvoravida/react-adal) and this [React MSAL sample](https://github.com/sunilbandla/react-msal-sample). Thanks!\n","readmeFilename":"README.md","gitHead":"a6dce543da567f429aafa8c263917d98a79b22e1","_id":"@yoss-org/react-azure-adb2c@0.3.2-lcbeta20","_npmVersion":"6.5.0","_nodeVersion":"11.8.0","_npmUser":{"name":"delwiv","email":"delwiv@gmail.com"},"dist":{"integrity":"sha512-OkCpFMXRdgnQ+WtqcV80JR7U6xvk98gIMQ1y4u/koslFeoa+u7ERq6ix+k/YnsJOmVQtxQiMClZO5JcT8RKHCw==","shasum":"cd7901fc2436dbf916765143b52dc105e38528ee","tarball":"https://registry.npmjs.org/@yoss-org/react-azure-adb2c/-/react-azure-adb2c-0.3.2-lcbeta20.tgz","fileCount":10,"unpackedSize":178858,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcTv+ICRA9TVsSAnZWagAARvgP/RskyUvxc7UODMx7dXup\npE8+osdeAEX4OIqt+/CUPupeep/SvbmIEzUVyeCcN4WH4r6wcgu2eWPQxR6H\nwe1VsYyC3n1QaXLQT4heEGE1wyAYX7Ihw88lKf+JUntbo9SzmGFUl0uRlnF+\nJl/GygWZ/l1Mnb5/70a48OjGloqQWzDzTBRhD6Z66tmvnUKAjck5ZIR8IVdV\nEvHBxwCTK/lNwqoC6PITM7oOsrr0+oyVaaFSDdY+iJjWkLWzqkb1/ZXYAs17\nP46l/elaachVzILk9uAxetRqrNWF8TNV0sFHxaLtrciZCFIwZwdRXcKan+U9\nmiZn2LYDVzUjPDFaDp6h2NDgoTLfpF+VIDOufONMQWQgTRUxE1P/lrglvmX9\nvVUWTU8O6aYADVx6djQiMvnkhNXr8j+O8piV1xnuPp79Aw3OnKiqa0052Eda\ne8DbtOtLDsCx9x4fF5+YSNEnQx3wJlOBomZ5ANnGMcfPydbRfJK0RVJZe9nH\ncmdL6bQXPdoGeM2JmAgTeKvguXTYX5ekmNcn7DzAzySy636OM9tOivzwEITl\no18T41xuAqUtvoKdrFnQC7miElNlYxWahRmS1FQI0v7NLdrgf4Lbuhxn54le\ntRKTTt4hk5uCtvDJS7WUFFowd+v9jRzWEM4/bwPMQLdnpT2hie6fuImv8J08\ngx7U\r\n=rk2L\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGMWM+K60amwRSjcHQhAWUDM5hj+3ODM/1F8dQj68M4VAiBjetc6CoBOvo4bhMkFnUhH4bxJulNIDShELo/d6fgtng=="}]},"maintainers":[{"name":"delwiv","email":"delwiv@gmail.com"},{"name":"fhou","email":"npm@bernardle.com"},{"name":"liryc","email":"cyril@oyst.com"},{"name":"nicolaschenet","email":"ironic51@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/react-azure-adb2c_0.3.2-lcbeta20_1548681096091_0.6849097437644074"},"_hasShrinkwrap":false},"0.3.2-lcbeta21":{"name":"@yoss-org/react-azure-adb2c","version":"0.3.2-lcbeta21","description":"Authentication library for Azure AD B2C and ReactJS","main":"lib/react-azure-adb2c.js","scripts":{"compile":"cross-env NODE_ENV=production babel src --out-dir lib","prepublish":"npm run compile"},"repository":{"type":"git","url":"git+https://github.com/jamesrandall/react-azure-adb2c.git"},"keywords":["react","js","AAD","B2C","oauth","azure"],"author":{"name":"Cyril HAGEGE"},"license":"MIT","bugs":{"url":"https://github.com/JamesRandall/react-azure-adb2c/issues"},"homepage":"https://github.com/JamesRandall/react-azure-adb2c#readme","dependencies":{"msal":"^0.1.5"},"peerDependencies":{"react":"^15.0.0 || ^16.0.0"},"devDependencies":{"babel-cli":"^6.26.0","babel-core":"6.24.1","babel-eslint":"^8.0.3","babel-jest":"20.0.3","babel-loader":"7.0.0","babel-plugin-import":"^1.2.1","babel-polyfill":"^6.23.0","babel-preset-env":"^1.6.1","babel-preset-react-app":"^3.0.0","babel-runtime":"6.23.0","cross-env":"^5.1.4","eslint":"^4.12.1","eslint-config-airbnb":"^16.1.0","eslint-config-defaults":"^9.0.0","eslint-plugin-import":"^2.8.0","eslint-plugin-jsx-a11y":"^6.0.2","eslint-plugin-react":"^7.5.1","eslint-plugin-sort-imports-es6-autofix":"^0.3.0"},"readme":"# README\n\nAzure AD B2C is a cost effective identity provider covering social and enterprise logins but it can be awekward to integrate with - its documentation is currently not great and using it involves rooting around across multiple samples, the ADAL library, and the MSAL library.\n\nThat being the case I've focused this package on B2C although with minor changes it could be used more broadly. MSAL itself, which this library wraps, is rather generic but B2C has some specific requirements and I think half of the problem with the documentation is that you end up drifting across B2C and straight AD. I wanted to make things simpler for B2C.\n\nHopefully this will help people writing React apps. It makes use of MSAL underneath and the core of it (other than protecting routes) will probably work with other frameworks too but I use React at the moment. As it's an SPA my assumption in the library and documentation below is that you ultimately want to get an access token that you can use to call remote APIs. See this [Azure AD B2C post here](https://docs.microsoft.com/en-us/azure/active-directory-b2c/active-directory-b2c-access-tokens) for details on how to set this up on the B2C side.\n\nPRs welcome!\n\n## Installation\n\nIf you are using npm:\n\n    npm install react-azure-adb2c --save\n\nOr if you are using yarn:\n\n    yarn add react-azure-adb2c\n\n## Initializing the Library\n\nYou'll first need to load the module and pass some configuration to the library. Normally this would go in your index.js file:\n\n    import authentication from 'react-azure-adb2c';\n    authentication.initialize({\n        // optional, will default to this\n        instance: 'https://login.microsoftonline.com/tfp/', \n        // your B2C tenant\n        tenant: 'myb2ctenant.onmicrosoft.com',\n        // the policy to use to sign in, can also be a sign up or sign in policy\n        signInPolicy: 'mysigninpolicy',\n        // the policy to use for password reset\n        resetPolicy: 'mypasswordresetpolicy',\n        // the the B2C application you want to authenticate with (that's just a random GUID - get yours from the portal)\n        applicationId: '75ee2b43-ad2c-4366-9b8f-84b7d19d776e',\n        // where MSAL will store state - localStorage or sessionStorage\n        cacheLocation: 'sessionStorage',\n        // the scopes you want included in the access token\n        scopes: ['https://myb2ctenant.onmicrosoft.com/management/admin'],\n        // optional, the redirect URI - if not specified MSAL will pick up the location from window.href\n        redirectUri: 'http://localhost:3000',\n        // optional, the URI to redirect to after logout\n        postLogoutRedirectUri: 'http://myapp.com'\n    });\n    \n## Authenticating When The App Starts\n\nIf you want to set things up so that a user is authenticated as soon as they hit your app (for example if you've got a link to an app from a landing page) then, in index.js, wrap the lines of code that launch the React app with the _authentication.run_ function:\n\n    authentication.run(() => {\n      ReactDOM.render(<App />, document.getElementById('root'));\n      registerServiceWorker();  \n    });\n\n## Triggering Authentication Based on Components Mounting (and routing)\n\nIf you want to set things up so that a user is authenticated as they visit a part of the application that requires authentication then the appropriate components can be wrapped inside higher order components that will handle the authentication process. This is done using the _authentication.required_ function, normally in conjunction with a router. The example below shows this using the popular react-router:\n\n    import React, { Component } from 'react';\n    import authentication from 'react-azure-adb2c'\n    import { BrowserRouter as Router, Route, Switch } from \"react-router-dom\";\n    import HomePage from './Homepage'\n    import MembersArea from './MembersArea'\n    \n    class App extends Component {\n      render() {\n        return (\n          <Router basename={process.env.PUBLIC_URL}>\n            <Switch>\n              <Route exact path=\"/\" component={HomePage} />\n              <Route exact path=\"/membersArea\" component={authentication.required(MembersArea)}>\n            </Switch>\n          </Router>\n        );\n      }\n    }\n\n## Getting the Access Token\n\nSimply call the method _getAccessToken_:\n\n    import authentication from 'react-azure-adb2c'\n\n    // ...\n\n    const token = authentication.getAccessToken();\n\n## Signing Out\n\nTo sign out:\n\n    import authentication from 'react-azure-adb2c'\n\n    // ...\n\n    authentication.signOut();\n\n## Thanks\n\nTo build this I made use of the B2C site, the [MSAL library docs](https://github.com/AzureAD/microsoft-authentication-library-for-js), the [react-adal source](https://github.com/salvoravida/react-adal) and this [React MSAL sample](https://github.com/sunilbandla/react-msal-sample). Thanks!\n","readmeFilename":"README.md","gitHead":"a6dce543da567f429aafa8c263917d98a79b22e1","_id":"@yoss-org/react-azure-adb2c@0.3.2-lcbeta21","_npmVersion":"6.5.0","_nodeVersion":"11.8.0","_npmUser":{"name":"delwiv","email":"delwiv@gmail.com"},"dist":{"integrity":"sha512-7SNuQvLxnb66GQlYnViIVSPtUKdnhLPKTNcEBb7Hvj7hiHudiCRPf9oiTUm9hKp63UGGA4WOM8rM7BSeMvpTLQ==","shasum":"29f2f9df0366792348c553e525cedb9fc3a86c6b","tarball":"https://registry.npmjs.org/@yoss-org/react-azure-adb2c/-/react-azure-adb2c-0.3.2-lcbeta21.tgz","fileCount":10,"unpackedSize":178940,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcTw99CRA9TVsSAnZWagAAfTYP/iCofCkod9/W+ip4lT0G\nUf/JcDIGB9F5zNgSsl9TH+HrCx3Tlk9f+FrJTuIZmYlfvxQplz9gdIwl8N/F\nlLQyKKQSidTsmtf21NAN5MFqPAlP2Zg4d0buBgCe/+6hGaQ1+YX0js37fhC+\nI5f7tGpr1F2UTZCNiLRqopy5E33l9W3hj4CfxSRACQx0WUcG5Xq/VcXHlBPv\nEeKAoSqsca4YBIh//z40eCDHCSqcDaayNEICyqhHcHv+jnY1N17iLOTBYklb\ncD742CTtnHtuZCw0Hf9PB8Ctq4gHkJsrHRcTFOCN2Ih8IHekDDzoYnnauGQg\ne+AxiU0MsDxOFEgV//EyKLQg1jqEJjTWBjpuSmzg8k72UUlqGoLdHRw+9IaZ\ngiGefdjquT5MZBcUsX646/NLY9nZa8Q7JAxFYl/NeMtBTmvKlFf/xhhbvNfO\nZJgz+d+LEdh9MYYyK/1X6y0dXf/gf37g/vdMg+m/sXbgHqxCcqbKVbHlzcSk\nCYErRZq9qxBiMvt9h16lLcU/dgChX2QiYHSHO67qRckNxPBc48ixBetIjHfj\nFPs87a0PQqmByeewZvjPRKGIywPNLqd5Tor4hMDMk+t1G4xQ3Cw0/+0rftyt\nM0H5mMcw9sGUrvQ+ukWpLIQsqPKf/MruwtkdOvJCAqHQiTDEPdx4R90wY8TB\njZg9\r\n=xT4G\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDNTqRVGp+arprlGmttke5IzeJBNf2qdEy9QWHM3x+mIgIhAN3YNmhtA0IaahCRxWphvQNEJGqAyS97YywO01WtUq8x"}]},"maintainers":[{"name":"delwiv","email":"delwiv@gmail.com"},{"name":"fhou","email":"npm@bernardle.com"},{"name":"liryc","email":"cyril@oyst.com"},{"name":"nicolaschenet","email":"ironic51@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/react-azure-adb2c_0.3.2-lcbeta21_1548685180172_0.6623719764007794"},"_hasShrinkwrap":false},"0.3.2-lcbeta22":{"name":"@yoss-org/react-azure-adb2c","version":"0.3.2-lcbeta22","description":"Authentication library for Azure AD B2C and ReactJS","main":"lib/react-azure-adb2c.js","scripts":{"compile":"cross-env NODE_ENV=production babel src --out-dir lib","prepublish":"npm run compile"},"repository":{"type":"git","url":"git+https://github.com/jamesrandall/react-azure-adb2c.git"},"keywords":["react","js","AAD","B2C","oauth","azure"],"author":{"name":"Cyril HAGEGE"},"license":"MIT","bugs":{"url":"https://github.com/JamesRandall/react-azure-adb2c/issues"},"homepage":"https://github.com/JamesRandall/react-azure-adb2c#readme","dependencies":{"msal":"^0.1.5"},"peerDependencies":{"react":"^15.0.0 || ^16.0.0"},"devDependencies":{"babel-cli":"^6.26.0","babel-core":"6.24.1","babel-eslint":"^8.0.3","babel-jest":"20.0.3","babel-loader":"7.0.0","babel-plugin-import":"^1.2.1","babel-polyfill":"^6.23.0","babel-preset-env":"^1.6.1","babel-preset-react-app":"^3.0.0","babel-runtime":"6.23.0","cross-env":"^5.1.4","eslint":"^4.12.1","eslint-config-airbnb":"^16.1.0","eslint-config-defaults":"^9.0.0","eslint-plugin-import":"^2.8.0","eslint-plugin-jsx-a11y":"^6.0.2","eslint-plugin-react":"^7.5.1","eslint-plugin-sort-imports-es6-autofix":"^0.3.0"},"readme":"# README\n\nAzure AD B2C is a cost effective identity provider covering social and enterprise logins but it can be awekward to integrate with - its documentation is currently not great and using it involves rooting around across multiple samples, the ADAL library, and the MSAL library.\n\nThat being the case I've focused this package on B2C although with minor changes it could be used more broadly. MSAL itself, which this library wraps, is rather generic but B2C has some specific requirements and I think half of the problem with the documentation is that you end up drifting across B2C and straight AD. I wanted to make things simpler for B2C.\n\nHopefully this will help people writing React apps. It makes use of MSAL underneath and the core of it (other than protecting routes) will probably work with other frameworks too but I use React at the moment. As it's an SPA my assumption in the library and documentation below is that you ultimately want to get an access token that you can use to call remote APIs. See this [Azure AD B2C post here](https://docs.microsoft.com/en-us/azure/active-directory-b2c/active-directory-b2c-access-tokens) for details on how to set this up on the B2C side.\n\nPRs welcome!\n\n## Installation\n\nIf you are using npm:\n\n    npm install react-azure-adb2c --save\n\nOr if you are using yarn:\n\n    yarn add react-azure-adb2c\n\n## Initializing the Library\n\nYou'll first need to load the module and pass some configuration to the library. Normally this would go in your index.js file:\n\n    import authentication from 'react-azure-adb2c';\n    authentication.initialize({\n        // optional, will default to this\n        instance: 'https://login.microsoftonline.com/tfp/', \n        // your B2C tenant\n        tenant: 'myb2ctenant.onmicrosoft.com',\n        // the policy to use to sign in, can also be a sign up or sign in policy\n        signInPolicy: 'mysigninpolicy',\n        // the policy to use for password reset\n        resetPolicy: 'mypasswordresetpolicy',\n        // the the B2C application you want to authenticate with (that's just a random GUID - get yours from the portal)\n        applicationId: '75ee2b43-ad2c-4366-9b8f-84b7d19d776e',\n        // where MSAL will store state - localStorage or sessionStorage\n        cacheLocation: 'sessionStorage',\n        // the scopes you want included in the access token\n        scopes: ['https://myb2ctenant.onmicrosoft.com/management/admin'],\n        // optional, the redirect URI - if not specified MSAL will pick up the location from window.href\n        redirectUri: 'http://localhost:3000',\n        // optional, the URI to redirect to after logout\n        postLogoutRedirectUri: 'http://myapp.com'\n    });\n    \n## Authenticating When The App Starts\n\nIf you want to set things up so that a user is authenticated as soon as they hit your app (for example if you've got a link to an app from a landing page) then, in index.js, wrap the lines of code that launch the React app with the _authentication.run_ function:\n\n    authentication.run(() => {\n      ReactDOM.render(<App />, document.getElementById('root'));\n      registerServiceWorker();  \n    });\n\n## Triggering Authentication Based on Components Mounting (and routing)\n\nIf you want to set things up so that a user is authenticated as they visit a part of the application that requires authentication then the appropriate components can be wrapped inside higher order components that will handle the authentication process. This is done using the _authentication.required_ function, normally in conjunction with a router. The example below shows this using the popular react-router:\n\n    import React, { Component } from 'react';\n    import authentication from 'react-azure-adb2c'\n    import { BrowserRouter as Router, Route, Switch } from \"react-router-dom\";\n    import HomePage from './Homepage'\n    import MembersArea from './MembersArea'\n    \n    class App extends Component {\n      render() {\n        return (\n          <Router basename={process.env.PUBLIC_URL}>\n            <Switch>\n              <Route exact path=\"/\" component={HomePage} />\n              <Route exact path=\"/membersArea\" component={authentication.required(MembersArea)}>\n            </Switch>\n          </Router>\n        );\n      }\n    }\n\n## Getting the Access Token\n\nSimply call the method _getAccessToken_:\n\n    import authentication from 'react-azure-adb2c'\n\n    // ...\n\n    const token = authentication.getAccessToken();\n\n## Signing Out\n\nTo sign out:\n\n    import authentication from 'react-azure-adb2c'\n\n    // ...\n\n    authentication.signOut();\n\n## Thanks\n\nTo build this I made use of the B2C site, the [MSAL library docs](https://github.com/AzureAD/microsoft-authentication-library-for-js), the [react-adal source](https://github.com/salvoravida/react-adal) and this [React MSAL sample](https://github.com/sunilbandla/react-msal-sample). Thanks!\n","readmeFilename":"README.md","gitHead":"a6dce543da567f429aafa8c263917d98a79b22e1","_id":"@yoss-org/react-azure-adb2c@0.3.2-lcbeta22","_npmVersion":"6.5.0","_nodeVersion":"11.8.0","_npmUser":{"name":"delwiv","email":"delwiv@gmail.com"},"dist":{"integrity":"sha512-jqouZowtn44sQm8GJ76Eerf9F4UdiIgqQNKml8inq1gJpHJ/PhNyoLe7NyWcOlSpRFqoYfX82IJAal3C06ExXA==","shasum":"b6151cab6f7bb881713ad884557f001b659b7bd9","tarball":"https://registry.npmjs.org/@yoss-org/react-azure-adb2c/-/react-azure-adb2c-0.3.2-lcbeta22.tgz","fileCount":10,"unpackedSize":179511,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcUFgrCRA9TVsSAnZWagAAsVYP/0vgCjoWTZva9tlfLGBi\nm2o+9IOusQRSeUvOrGy3QybpklE2nhHgeI5nQE+M7kgQuCn5M6E8W7mWqejj\nj6fWUziBuvZcLXux/EAky93PsA2m0KowRkD/uWGta1jsWebfdSzWP+dhWFXJ\nGUQedpPdtNet5UTTmNFJUNO9aGO+VuMYLB0nFFAmESlHYHWpP2Gy8kOig13T\n1pzu2RXPVJbXNZWie+P4dq1Du1t0lPzQBVG/g6mJXlXY1crfqzCgEBnI/G0I\nq3JEyQcgSGmIBBrPd0tPrTGEiD78qMeRRNUDBlHq/R0bQPI6u/OiYbL3Pwb9\nuaDKI2IY/9zMOECq7pXHISJblCn8EBDtvsAji7Xcr0Aw5b8J9WdwDK253Rhs\nzzI2xsbwMZQsbjuFZ1pyUT6eLfo3gmMj+DbB94NJGG4M0QnstOpO7tDc7A2J\nxABq9H8EWPa7He04k3aWy8QBmQQRTP3Fs7gNu5OhjY241ViDx6X0jALeCG83\nAa/57HSGe2Ypxp7i55Dpjvp6g/Xkd6Qd3NY4o/TarBYUW1x7Tx4JTAzrGThn\n9YyrqIkSNCUYbJqZVMGuLtF8gGNYlFZ2gTjIIN9PJd4U6NI5FRfUrnJhnM4v\n/I+IghQUtMOz77cGmDwT8fbhu4B7ydlq/1VGFk5jDUYz4JfmnCHZWHYl7/ey\nwueq\r\n=KBCh\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDU4PYMHaI9W739DGLX1WFM0SO5/Qxw0aqMC5XMHtVhjAiBm1jce33xOsxYc1fTucMycSUQNrdqVZGrU0SKawdcxFA=="}]},"maintainers":[{"name":"delwiv","email":"delwiv@gmail.com"},{"name":"fhou","email":"npm@bernardle.com"},{"name":"liryc","email":"cyril@oyst.com"},{"name":"nicolaschenet","email":"ironic51@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/react-azure-adb2c_0.3.2-lcbeta22_1548769322586_0.23683103576542286"},"_hasShrinkwrap":false},"0.3.2-lcbeta23":{"name":"@yoss-org/react-azure-adb2c","version":"0.3.2-lcbeta23","description":"Authentication library for Azure AD B2C and ReactJS","main":"lib/react-azure-adb2c.js","scripts":{"compile":"cross-env NODE_ENV=production babel src --out-dir lib","prepublish":"npm run compile"},"repository":{"type":"git","url":"git+https://github.com/jamesrandall/react-azure-adb2c.git"},"keywords":["react","js","AAD","B2C","oauth","azure"],"author":{"name":"Cyril HAGEGE"},"license":"MIT","bugs":{"url":"https://github.com/JamesRandall/react-azure-adb2c/issues"},"homepage":"https://github.com/JamesRandall/react-azure-adb2c#readme","dependencies":{"msal":"^0.1.5"},"peerDependencies":{"react":"^15.0.0 || ^16.0.0"},"devDependencies":{"babel-cli":"^6.26.0","babel-core":"6.24.1","babel-eslint":"^8.0.3","babel-jest":"20.0.3","babel-loader":"7.0.0","babel-plugin-import":"^1.2.1","babel-polyfill":"^6.23.0","babel-preset-env":"^1.6.1","babel-preset-react-app":"^3.0.0","babel-runtime":"6.23.0","cross-env":"^5.1.4","eslint":"^4.12.1","eslint-config-airbnb":"^16.1.0","eslint-config-defaults":"^9.0.0","eslint-plugin-import":"^2.8.0","eslint-plugin-jsx-a11y":"^6.0.2","eslint-plugin-react":"^7.5.1","eslint-plugin-sort-imports-es6-autofix":"^0.3.0"},"readme":"# README\n\nAzure AD B2C is a cost effective identity provider covering social and enterprise logins but it can be awekward to integrate with - its documentation is currently not great and using it involves rooting around across multiple samples, the ADAL library, and the MSAL library.\n\nThat being the case I've focused this package on B2C although with minor changes it could be used more broadly. MSAL itself, which this library wraps, is rather generic but B2C has some specific requirements and I think half of the problem with the documentation is that you end up drifting across B2C and straight AD. I wanted to make things simpler for B2C.\n\nHopefully this will help people writing React apps. It makes use of MSAL underneath and the core of it (other than protecting routes) will probably work with other frameworks too but I use React at the moment. As it's an SPA my assumption in the library and documentation below is that you ultimately want to get an access token that you can use to call remote APIs. See this [Azure AD B2C post here](https://docs.microsoft.com/en-us/azure/active-directory-b2c/active-directory-b2c-access-tokens) for details on how to set this up on the B2C side.\n\nPRs welcome!\n\n## Installation\n\nIf you are using npm:\n\n    npm install react-azure-adb2c --save\n\nOr if you are using yarn:\n\n    yarn add react-azure-adb2c\n\n## Initializing the Library\n\nYou'll first need to load the module and pass some configuration to the library. Normally this would go in your index.js file:\n\n    import authentication from 'react-azure-adb2c';\n    authentication.initialize({\n        // optional, will default to this\n        instance: 'https://login.microsoftonline.com/tfp/', \n        // your B2C tenant\n        tenant: 'myb2ctenant.onmicrosoft.com',\n        // the policy to use to sign in, can also be a sign up or sign in policy\n        signInPolicy: 'mysigninpolicy',\n        // the policy to use for password reset\n        resetPolicy: 'mypasswordresetpolicy',\n        // the the B2C application you want to authenticate with (that's just a random GUID - get yours from the portal)\n        applicationId: '75ee2b43-ad2c-4366-9b8f-84b7d19d776e',\n        // where MSAL will store state - localStorage or sessionStorage\n        cacheLocation: 'sessionStorage',\n        // the scopes you want included in the access token\n        scopes: ['https://myb2ctenant.onmicrosoft.com/management/admin'],\n        // optional, the redirect URI - if not specified MSAL will pick up the location from window.href\n        redirectUri: 'http://localhost:3000',\n        // optional, the URI to redirect to after logout\n        postLogoutRedirectUri: 'http://myapp.com'\n    });\n    \n## Authenticating When The App Starts\n\nIf you want to set things up so that a user is authenticated as soon as they hit your app (for example if you've got a link to an app from a landing page) then, in index.js, wrap the lines of code that launch the React app with the _authentication.run_ function:\n\n    authentication.run(() => {\n      ReactDOM.render(<App />, document.getElementById('root'));\n      registerServiceWorker();  \n    });\n\n## Triggering Authentication Based on Components Mounting (and routing)\n\nIf you want to set things up so that a user is authenticated as they visit a part of the application that requires authentication then the appropriate components can be wrapped inside higher order components that will handle the authentication process. This is done using the _authentication.required_ function, normally in conjunction with a router. The example below shows this using the popular react-router:\n\n    import React, { Component } from 'react';\n    import authentication from 'react-azure-adb2c'\n    import { BrowserRouter as Router, Route, Switch } from \"react-router-dom\";\n    import HomePage from './Homepage'\n    import MembersArea from './MembersArea'\n    \n    class App extends Component {\n      render() {\n        return (\n          <Router basename={process.env.PUBLIC_URL}>\n            <Switch>\n              <Route exact path=\"/\" component={HomePage} />\n              <Route exact path=\"/membersArea\" component={authentication.required(MembersArea)}>\n            </Switch>\n          </Router>\n        );\n      }\n    }\n\n## Getting the Access Token\n\nSimply call the method _getAccessToken_:\n\n    import authentication from 'react-azure-adb2c'\n\n    // ...\n\n    const token = authentication.getAccessToken();\n\n## Signing Out\n\nTo sign out:\n\n    import authentication from 'react-azure-adb2c'\n\n    // ...\n\n    authentication.signOut();\n\n## Thanks\n\nTo build this I made use of the B2C site, the [MSAL library docs](https://github.com/AzureAD/microsoft-authentication-library-for-js), the [react-adal source](https://github.com/salvoravida/react-adal) and this [React MSAL sample](https://github.com/sunilbandla/react-msal-sample). Thanks!\n","readmeFilename":"README.md","gitHead":"a6dce543da567f429aafa8c263917d98a79b22e1","_id":"@yoss-org/react-azure-adb2c@0.3.2-lcbeta23","_npmVersion":"6.5.0","_nodeVersion":"11.8.0","_npmUser":{"name":"delwiv","email":"delwiv@gmail.com"},"dist":{"integrity":"sha512-L9lJpibFxShbIoqd0/Hw1hTNElG/crnt3H/+BWhjY/XLuuDKiHThsC2XFN9WSG2EanAtt7Jh58CE8q7K9iyD+w==","shasum":"3c4bb2f6e69a959d4d0f943312e19093ee36142f","tarball":"https://registry.npmjs.org/@yoss-org/react-azure-adb2c/-/react-azure-adb2c-0.3.2-lcbeta23.tgz","fileCount":10,"unpackedSize":179112,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcUFnoCRA9TVsSAnZWagAAersP/iSkjvZFwx6DtLIimW5x\nb75UupelaBMsAIblgLIyru1hQS63mFjAK7kXYWHiT8dhQQmoQ/l5ST0obrHJ\n+Gkxzhyj49khH5wgB6d3iSL1omWIHU/BHuflXFXd21OupXSCD24efbQhTyGc\n/N8CRIrp11yXmBMjC+/VmV7A0WA2lBNhWzWxeAxmyQ17csKoEtDOfEU8Ar0+\nMh5NeSqkvu/hISRwyq8N3P2V4tbPYi5uWfa0h0mGkJ4vxpk8HdK0bi0xmhxp\nx1bTTbgijtDKVz6xeixkPAo9hAIOwjBwumHNLWFCmjFfzwnDal2EVDaRMhO1\nv/n8PO73pva5R9PAjSFAF6w2qDm7oN1Bl5v7KDTCI534x0wNec29LD4H3P+4\noW3gVPAUYkkdplkA+ZAwZ3PVNnnyyj831e+VXJJcs18fb1wb6rWSUdSskJw3\nAKsBmfplTruYuGDSwE0jAVXI+7YW93WTVxW/Gp8PO5D31xT0yS2lYaOEPkgZ\n0QqZbaI3q0SdWDSu6zNmKzZrvIvcxwJaxXxQIW3vrNA4qr6zXvSuPKU4Rhm7\n6wZRl4HLrFGE/Ao07vWaIl1H/htfl0lzxTJcoBjczQQt7E7h8H/P20aIUOgv\nFwmY+IgBbT4qkAH4Y7N/sNKrSozWNLJuYDx2sGVBN9mSBV5Af0D06ug0gFBw\ny0iu\r\n=Rq86\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGR/A1emyYKw54yRETBSHjQIsHmwH2+dR9ZMl6lAe56EAiAGMh61qh+I5ZArqOJXnOYEAgM/ijzcwCAnDboYZZJkgQ=="}]},"maintainers":[{"name":"delwiv","email":"delwiv@gmail.com"},{"name":"fhou","email":"npm@bernardle.com"},{"name":"liryc","email":"cyril@oyst.com"},{"name":"nicolaschenet","email":"ironic51@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/react-azure-adb2c_0.3.2-lcbeta23_1548769767845_0.745950371430274"},"_hasShrinkwrap":false},"0.2.2-lcbeta1":{"name":"@yoss-org/react-azure-adb2c","version":"0.2.2-lcbeta1","description":"Authentication library for Azure AD B2C and ReactJS","main":"lib/react-azure-adb2c.js","scripts":{"compile":"cross-env NODE_ENV=production babel src --out-dir lib","prepublish":"npm run compile"},"repository":{"type":"git","url":"git+https://github.com/jamesrandall/react-azure-adb2c.git"},"keywords":["react","js","AAD","B2C","oauth","azure"],"author":{"name":"Cyril HAGEGE"},"license":"MIT","bugs":{"url":"https://github.com/JamesRandall/react-azure-adb2c/issues"},"homepage":"https://github.com/JamesRandall/react-azure-adb2c#readme","dependencies":{"msal":"^0.1.5"},"peerDependencies":{"react":"^15.0.0 || ^16.0.0"},"devDependencies":{"babel-cli":"^6.26.0","babel-core":"6.24.1","babel-eslint":"^8.0.3","babel-jest":"20.0.3","babel-loader":"7.0.0","babel-plugin-import":"^1.2.1","babel-polyfill":"^6.23.0","babel-preset-env":"^1.6.1","babel-preset-react-app":"^3.0.0","babel-runtime":"6.23.0","cross-env":"^5.1.4","eslint":"^5.12.1","eslint-config-airbnb":"^16.1.0","eslint-config-defaults":"^9.0.0","eslint-plugin-import":"^2.8.0","eslint-plugin-jsx-a11y":"^6.0.2","eslint-plugin-react":"^7.5.1","eslint-plugin-sort-imports-es6-autofix":"^0.3.0"},"gitHead":"bb39b9b2f3c2e5ccfcfcbdcc9252d2531de287f7","readme":"# README\n\nAzure AD B2C is a cost effective identity provider covering social and enterprise logins but it can be awekward to integrate with - its documentation is currently not great and using it involves rooting around across multiple samples, the ADAL library, and the MSAL library.\n\nThat being the case I've focused this package on B2C although with minor changes it could be used more broadly. MSAL itself, which this library wraps, is rather generic but B2C has some specific requirements and I think half of the problem with the documentation is that you end up drifting across B2C and straight AD. I wanted to make things simpler for B2C.\n\nHopefully this will help people writing React apps. It makes use of MSAL underneath and the core of it (other than protecting routes) will probably work with other frameworks too but I use React at the moment. As it's an SPA my assumption in the library and documentation below is that you ultimately want to get an access token that you can use to call remote APIs. See this [Azure AD B2C post here](https://docs.microsoft.com/en-us/azure/active-directory-b2c/active-directory-b2c-access-tokens) for details on how to set this up on the B2C side.\n\nPRs welcome!\n\n## Installation\n\nIf you are using npm:\n\n    npm install react-azure-adb2c --save\n\nOr if you are using yarn:\n\n    yarn add react-azure-adb2c\n\n## Initializing the Library\n\nYou'll first need to load the module and pass some configuration to the library. Normally this would go in your index.js file:\n\n    import authentication from 'react-azure-adb2c';\n    authentication.initialize({\n        // optional, will default to this\n        instance: 'https://login.microsoftonline.com/tfp/', \n        // your B2C tenant\n        tenant: 'myb2ctenant.onmicrosoft.com',\n        // the policy to use to sign in, can also be a sign up or sign in policy\n        signInPolicy: 'mysigninpolicy',\n        // the policy to use for password reset\n        resetPolicy: 'mypasswordresetpolicy',\n        // the the B2C application you want to authenticate with (that's just a random GUID - get yours from the portal)\n        applicationId: '75ee2b43-ad2c-4366-9b8f-84b7d19d776e',\n        // where MSAL will store state - localStorage or sessionStorage\n        cacheLocation: 'sessionStorage',\n        // the scopes you want included in the access token\n        scopes: ['https://myb2ctenant.onmicrosoft.com/management/admin'],\n        // optional, the redirect URI - if not specified MSAL will pick up the location from window.href\n        redirectUri: 'http://localhost:3000',\n        // optional, the URI to redirect to after logout\n        postLogoutRedirectUri: 'http://myapp.com'\n    });\n    \n## Authenticating When The App Starts\n\nIf you want to set things up so that a user is authenticated as soon as they hit your app (for example if you've got a link to an app from a landing page) then, in index.js, wrap the lines of code that launch the React app with the _authentication.run_ function:\n\n    authentication.run(() => {\n      ReactDOM.render(<App />, document.getElementById('root'));\n      registerServiceWorker();  \n    });\n\n## Triggering Authentication Based on Components Mounting (and routing)\n\nIf you want to set things up so that a user is authenticated as they visit a part of the application that requires authentication then the appropriate components can be wrapped inside higher order components that will handle the authentication process. This is done using the _authentication.required_ function, normally in conjunction with a router. The example below shows this using the popular react-router:\n\n    import React, { Component } from 'react';\n    import authentication from 'react-azure-adb2c'\n    import { BrowserRouter as Router, Route, Switch } from \"react-router-dom\";\n    import HomePage from './Homepage'\n    import MembersArea from './MembersArea'\n    \n    class App extends Component {\n      render() {\n        return (\n          <Router basename={process.env.PUBLIC_URL}>\n            <Switch>\n              <Route exact path=\"/\" component={HomePage} />\n              <Route exact path=\"/membersArea\" component={authentication.required(MembersArea)}>\n            </Switch>\n          </Router>\n        );\n      }\n    }\n\n## Getting the Access Token\n\nSimply call the method _getAccessToken_:\n\n    import authentication from 'react-azure-adb2c'\n\n    // ...\n\n    const token = authentication.getAccessToken();\n\n## Signing Out\n\nTo sign out:\n\n    import authentication from 'react-azure-adb2c'\n\n    // ...\n\n    authentication.signOut();\n\n## Thanks\n\nTo build this I made use of the B2C site, the [MSAL library docs](https://github.com/AzureAD/microsoft-authentication-library-for-js), the [react-adal source](https://github.com/salvoravida/react-adal) and this [React MSAL sample](https://github.com/sunilbandla/react-msal-sample). Thanks!\n","readmeFilename":"README.md","_id":"@yoss-org/react-azure-adb2c@0.2.2-lcbeta1","_nodeVersion":"11.8.0","_npmVersion":"6.7.0","dist":{"integrity":"sha512-7ebINKNz76PkGRfLv+6TE8vGnb+lFoYs4zQYP5VukJVodfYE73Of2PN84bfmhvssKCbNXacPZ+ZoJpeWIFC0qg==","shasum":"a114deeef92b3510fe2a2aa469313372cd7ff3ad","tarball":"https://registry.npmjs.org/@yoss-org/react-azure-adb2c/-/react-azure-adb2c-0.2.2-lcbeta1.tgz","fileCount":9,"unpackedSize":152829,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcUsSxCRA9TVsSAnZWagAArLgP/0Zk1v9dAPpkM6VqgGdD\njGQWmFDPS/WEgUWIxQ0V6WTj81CILEkRiP8sodiNjqtSLxvekSy3uux8x2O/\nvLplMb6D8x3lcJ0sXG55Fqb6vLxcLdmRCimOg6sk6Kdf+RIJXGRZ8ojUd6dp\nDqrBQAXLzOsAyDwOP0b8fcF5Y2VzJ8Rh5OcJdmSA+FeLJF2z/e8HwXy8MGrj\nO71Uyccj1A1VijQV3zEHLbD/IUzH7Py6yoDIrqRfijsp0jH59eksGvkS5EJ4\nog+3kCsBxEruuwbsudCBc7JvPXxwNngdWjWKHfpsazMy6CnCayrPgxBkGGJn\nUMgmwNmd3+bexoJBB5s4H0/3Ud2UBXKiA7iyQcYSWRcV5WuEpZ4tMh9OnVvB\nf+CPzrEOyqPELo6PCrlX5XJgh3lkUSmt5OLjUJyEZvr9+Prk/P7S1Cumlve9\ndcFf+2DAwu3Fk57xAhtX9rH83WDNAQJ75QWAKl28QLDBpYJUQdRLV1a2BKX5\nOpx4fAk/fxqztaDrtePKgBSKoHamIbwiGcP5AQ1LRtW/ZuZTjz3qjrFtkg/U\nfgdTB+8QVgZ/sdj5Rq8SjjPptCjaRnqOuDWsV5/jkgZb9s18EL3UbNFIJaPk\n8TfszbPr4YldSDHNKqzx2L05GFPgWs/Gow1u5MlyW9I5V5mjBHhCC/+m2ANh\nlefv\r\n=d+y+\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHsaxKBkJIWbNpZ2bAHLgrBZHYOUyKUCIlpLf8ID7ngWAiEA2Puo6KmdwqmYy3C1W5TwRgH7DULUrYJpnuyzVaUWLXA="}]},"maintainers":[{"name":"delwiv","email":"delwiv@gmail.com"},{"name":"fhou","email":"npm@bernardle.com"},{"name":"liryc","email":"cyril@oyst.com"},{"name":"nicolaschenet","email":"ironic51@gmail.com"}],"_npmUser":{"name":"delwiv","email":"delwiv@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/react-azure-adb2c_0.2.2-lcbeta1_1548928176987_0.9679666645749385"},"_hasShrinkwrap":false},"0.2.2-lcbeta2":{"name":"@yoss-org/react-azure-adb2c","version":"0.2.2-lcbeta2","description":"Authentication library for Azure AD B2C and ReactJS","main":"lib/react-azure-adb2c.js","scripts":{"compile":"cross-env NODE_ENV=production babel src --out-dir lib","prepublish":"npm run compile"},"repository":{"type":"git","url":"git+https://github.com/jamesrandall/react-azure-adb2c.git"},"keywords":["react","js","AAD","B2C","oauth","azure"],"author":{"name":"Cyril HAGEGE"},"license":"MIT","bugs":{"url":"https://github.com/JamesRandall/react-azure-adb2c/issues"},"homepage":"https://github.com/JamesRandall/react-azure-adb2c#readme","dependencies":{"msal":"^0.1.5"},"peerDependencies":{"react":"^15.0.0 || ^16.0.0"},"devDependencies":{"babel-cli":"^6.26.0","babel-core":"6.24.1","babel-eslint":"^8.0.3","babel-jest":"20.0.3","babel-loader":"7.0.0","babel-plugin-import":"^1.2.1","babel-polyfill":"^6.23.0","babel-preset-env":"^1.6.1","babel-preset-react-app":"^3.0.0","babel-runtime":"6.23.0","cross-env":"^5.1.4","eslint":"^5.12.1","eslint-config-airbnb":"^16.1.0","eslint-config-defaults":"^9.0.0","eslint-plugin-import":"^2.8.0","eslint-plugin-jsx-a11y":"^6.0.2","eslint-plugin-react":"^7.5.1","eslint-plugin-sort-imports-es6-autofix":"^0.3.0"},"gitHead":"bb39b9b2f3c2e5ccfcfcbdcc9252d2531de287f7","readme":"# README\n\nAzure AD B2C is a cost effective identity provider covering social and enterprise logins but it can be awekward to integrate with - its documentation is currently not great and using it involves rooting around across multiple samples, the ADAL library, and the MSAL library.\n\nThat being the case I've focused this package on B2C although with minor changes it could be used more broadly. MSAL itself, which this library wraps, is rather generic but B2C has some specific requirements and I think half of the problem with the documentation is that you end up drifting across B2C and straight AD. I wanted to make things simpler for B2C.\n\nHopefully this will help people writing React apps. It makes use of MSAL underneath and the core of it (other than protecting routes) will probably work with other frameworks too but I use React at the moment. As it's an SPA my assumption in the library and documentation below is that you ultimately want to get an access token that you can use to call remote APIs. See this [Azure AD B2C post here](https://docs.microsoft.com/en-us/azure/active-directory-b2c/active-directory-b2c-access-tokens) for details on how to set this up on the B2C side.\n\nPRs welcome!\n\n## Installation\n\nIf you are using npm:\n\n    npm install react-azure-adb2c --save\n\nOr if you are using yarn:\n\n    yarn add react-azure-adb2c\n\n## Initializing the Library\n\nYou'll first need to load the module and pass some configuration to the library. Normally this would go in your index.js file:\n\n    import authentication from 'react-azure-adb2c';\n    authentication.initialize({\n        // optional, will default to this\n        instance: 'https://login.microsoftonline.com/tfp/', \n        // your B2C tenant\n        tenant: 'myb2ctenant.onmicrosoft.com',\n        // the policy to use to sign in, can also be a sign up or sign in policy\n        signInPolicy: 'mysigninpolicy',\n        // the policy to use for password reset\n        resetPolicy: 'mypasswordresetpolicy',\n        // the the B2C application you want to authenticate with (that's just a random GUID - get yours from the portal)\n        applicationId: '75ee2b43-ad2c-4366-9b8f-84b7d19d776e',\n        // where MSAL will store state - localStorage or sessionStorage\n        cacheLocation: 'sessionStorage',\n        // the scopes you want included in the access token\n        scopes: ['https://myb2ctenant.onmicrosoft.com/management/admin'],\n        // optional, the redirect URI - if not specified MSAL will pick up the location from window.href\n        redirectUri: 'http://localhost:3000',\n        // optional, the URI to redirect to after logout\n        postLogoutRedirectUri: 'http://myapp.com'\n    });\n    \n## Authenticating When The App Starts\n\nIf you want to set things up so that a user is authenticated as soon as they hit your app (for example if you've got a link to an app from a landing page) then, in index.js, wrap the lines of code that launch the React app with the _authentication.run_ function:\n\n    authentication.run(() => {\n      ReactDOM.render(<App />, document.getElementById('root'));\n      registerServiceWorker();  \n    });\n\n## Triggering Authentication Based on Components Mounting (and routing)\n\nIf you want to set things up so that a user is authenticated as they visit a part of the application that requires authentication then the appropriate components can be wrapped inside higher order components that will handle the authentication process. This is done using the _authentication.required_ function, normally in conjunction with a router. The example below shows this using the popular react-router:\n\n    import React, { Component } from 'react';\n    import authentication from 'react-azure-adb2c'\n    import { BrowserRouter as Router, Route, Switch } from \"react-router-dom\";\n    import HomePage from './Homepage'\n    import MembersArea from './MembersArea'\n    \n    class App extends Component {\n      render() {\n        return (\n          <Router basename={process.env.PUBLIC_URL}>\n            <Switch>\n              <Route exact path=\"/\" component={HomePage} />\n              <Route exact path=\"/membersArea\" component={authentication.required(MembersArea)}>\n            </Switch>\n          </Router>\n        );\n      }\n    }\n\n## Getting the Access Token\n\nSimply call the method _getAccessToken_:\n\n    import authentication from 'react-azure-adb2c'\n\n    // ...\n\n    const token = authentication.getAccessToken();\n\n## Signing Out\n\nTo sign out:\n\n    import authentication from 'react-azure-adb2c'\n\n    // ...\n\n    authentication.signOut();\n\n## Thanks\n\nTo build this I made use of the B2C site, the [MSAL library docs](https://github.com/AzureAD/microsoft-authentication-library-for-js), the [react-adal source](https://github.com/salvoravida/react-adal) and this [React MSAL sample](https://github.com/sunilbandla/react-msal-sample). Thanks!\n","readmeFilename":"README.md","_id":"@yoss-org/react-azure-adb2c@0.2.2-lcbeta2","_nodeVersion":"11.8.0","_npmVersion":"6.7.0","dist":{"integrity":"sha512-XSi6WnzFt0BJU6mCeGT6bWQtcPrV1u5Y6by2F3PEBkCGwWH7Mq8vg4Nk0P/8nDuRzWBKtSAOHpnuxfxnBQs13g==","shasum":"e73f1500cad1ac14151b0aeb78d201c4cc02afe3","tarball":"https://registry.npmjs.org/@yoss-org/react-azure-adb2c/-/react-azure-adb2c-0.2.2-lcbeta2.tgz","fileCount":9,"unpackedSize":152839,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcUsUzCRA9TVsSAnZWagAA7SUP/iLdUC6B88Ogrt4ya13u\nxuY4uTPQF3uYPSnwzQNFt9OeunVhlbCTiJvCgo7jRKnGvms2MlIqxhKC4Uc0\nK9dU3sJj7jV1+LNrwbdQhcZ1hgGGIJtXB9YCa9Okkh9m776C+1EQLLhMcPNe\nBYPKdfeYfthth8GS6rF92UqT/GbmiD2sURTJLZNWIdUKX6gxeFl+I1MekS36\n6EXZC8FdiitvM8pxqH80JcyT8vwXuGW9qZbEV3vcObrnAIhidFC3RNIUdm2X\nSEbqbV8UkKTT1tzqTUofXHOJkH/Kiry6uktvHNrZpxznTqvrA7ZOk9kJE/Bf\n+Vx2L3fz38xwIju96pvgsIQho9dMeSzbcpTVpOfDVmLE4pFPmgLkr3ubd/DR\nKzrOjkPFrhLNvayCqB/wN4Lcx0KejQJGDc06sKvtDIv+4QqVi/leCbh4l1qE\njRVqYJVc7XWWg+vSQrToFY1gAgcl+7cnPLiIl0e0QELhDiuSAg3l5WCOteki\nzudZLXwInDhO10ra2Qa1aY9wBUFJjonkClKpoP3JVS4rCf5TvPgZVhz0bsvY\ns8CW106Hf0vB1P2fQKLkQzfMHn/KgqSAzT1d4wFGw6nLIBs0QaPHEhx1WU2S\nwybww335tByJLtjQnSgAtpkAqk7kkG+xahnaKIcXjlIs7D3xi4HlS8JQG39M\n0WOv\r\n=M5bz\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCN37l4SamfNs/vELyz9Xdbg59aPFcB208LDD737ibndQIhAIuniiR9sRl1Nz/XZ58h+s2mtB9nJVXaSMZEzIVTDvAH"}]},"maintainers":[{"name":"delwiv","email":"delwiv@gmail.com"},{"name":"fhou","email":"npm@bernardle.com"},{"name":"liryc","email":"cyril@oyst.com"},{"name":"nicolaschenet","email":"ironic51@gmail.com"}],"_npmUser":{"name":"delwiv","email":"delwiv@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/react-azure-adb2c_0.2.2-lcbeta2_1548928307029_0.6455987836800041"},"_hasShrinkwrap":false},"0.3.2":{"name":"@yoss-org/react-azure-adb2c","version":"0.3.2","description":"Authentication library for Azure AD B2C and ReactJS","main":"lib/react-azure-adb2c.js","scripts":{"compile":"cross-env NODE_ENV=production babel src --out-dir lib","prepublish":"npm run compile"},"repository":{"type":"git","url":"git+https://github.com/jamesrandall/react-azure-adb2c.git"},"keywords":["react","js","AAD","B2C","oauth","azure"],"author":{"name":"Cyril HAGEGE"},"license":"MIT","bugs":{"url":"https://github.com/JamesRandall/react-azure-adb2c/issues"},"homepage":"https://github.com/JamesRandall/react-azure-adb2c#readme","dependencies":{"msal":"^0.1.5"},"peerDependencies":{"react":"^15.0.0 || ^16.0.0"},"devDependencies":{"babel-cli":"^6.26.0","babel-core":"6.24.1","babel-eslint":"^8.0.3","babel-jest":"20.0.3","babel-loader":"7.0.0","babel-plugin-import":"^1.2.1","babel-polyfill":"^6.23.0","babel-preset-env":"^1.6.1","babel-preset-react-app":"^3.0.0","babel-runtime":"6.23.0","cross-env":"^5.1.4","eslint":"^5.12.1","eslint-config-airbnb":"^16.1.0","eslint-config-defaults":"^9.0.0","eslint-plugin-import":"^2.8.0","eslint-plugin-jsx-a11y":"^6.0.2","eslint-plugin-react":"^7.5.1","eslint-plugin-sort-imports-es6-autofix":"^0.3.0"},"gitHead":"7c52f8b765fa81b59b9cf943e1b322b2456a31a7","_id":"@yoss-org/react-azure-adb2c@0.3.2","_nodeVersion":"11.8.0","_npmVersion":"6.7.0","dist":{"integrity":"sha512-bHE+3FF/o3ii97Cak+Q0x1atcPENKmoMFKUmKwqh8hz4A2eE37bViJYabYVEz5aU9EbymouAsFF6YwSpSKoFqA==","shasum":"76aa3c5e68c04b576be987f9bdce981e0d9113a9","tarball":"https://registry.npmjs.org/@yoss-org/react-azure-adb2c/-/react-azure-adb2c-0.3.2.tgz","fileCount":9,"unpackedSize":152831,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcUxzsCRA9TVsSAnZWagAAkncP/j9qVHm+1k2LlEBwkwQT\npACJef9rpEbv1uVjh0kNk/bawphscpOy4wxQI0qpfZzeGdkS5GWF84E5/sIx\nmDXSkgqqBHW5STD9Uk6UmjTkKxRNAGlmGb5CzLrGBfrF9/bnguui9OS6YHsX\nR6RqXfJVPugAi87K4UcfxBazmewUj13SwDb3uhn5VFPKopk9a2w3HuhmGUYK\nSpOI7+Rc8p8Hp27Y+V+qcVlnrWWe0rLfP1RjloLFLx1mg/WYCpSMXVRFl99z\nlAv3H2lXOtAilQGa4qtwGEVNSHQIqrwTCI7j8lsyqbnmZyxWMMDjnHkOWk7x\nwieg9s1pHyCsiINc2BXxtEgfXzDhgePNkpBgGzY13nJZWWX+lHpYGmeOM3Hd\nFeOHnKOYtT0NWeepZhvbUPJXo4FQL5TKZb33V6kVromfg5yzIeE4sRRkYWOg\nLY2WMa6WnEmmeVLdD4dM3a1WFXwCT+6MVyYesWCTVB6jAncQVML/zBQChp6O\nxEjiKU2lHjqH0ZAKH1lDypyrRdk5W4BGpzzDUb3bPe6euk58PGs4yufE2xW6\nFae9Q2BWdB7GEzl0wciJYoJZhfgpgk6vcq3GR5yaey+ncx3ehg1wk93ZEkYy\njseyPkw9ugthnp6lhCfkKuvpZ5rmsx/M+rp5XvnU4jJXi3JHlilNjjsi1tcb\nAN1E\r\n=bH6W\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHrSnwrU6AQanOI2R+TxQSKvf0+6h0i8cZ48PXa6fZJtAiAc6xaPNdazxQNwEC2xMJAa6stJao0gqEI3TXjW11rSqw=="}]},"maintainers":[{"name":"delwiv","email":"delwiv@gmail.com"},{"name":"fhou","email":"npm@bernardle.com"},{"name":"liryc","email":"cyril@oyst.com"},{"name":"nicolaschenet","email":"ironic51@gmail.com"}],"_npmUser":{"name":"delwiv","email":"delwiv@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/react-azure-adb2c_0.3.2_1548950763727_0.6066345487402718"},"_hasShrinkwrap":false}},"time":{"created":"2018-12-10T15:04:27.983Z","0.2.1":"2018-12-10T15:04:28.324Z","modified":"2022-04-11T11:12:58.323Z","0.3.0":"2019-01-16T14:22:07.654Z","0.3.1":"2019-01-22T15:32:32.382Z","0.3.2-lcbeta1":"2019-01-23T18:10:24.549Z","0.3.2-lcbeta2":"2019-01-23T18:19:36.883Z","0.3.2-lcbeta3":"2019-01-23T18:20:07.479Z","0.3.2-lcbeta4":"2019-01-24T17:38:30.287Z","0.3.2-lcbeta5":"2019-01-24T18:38:24.472Z","0.3.2-lcbeta6":"2019-01-24T19:01:51.374Z","0.3.2-lcbeta7":"2019-01-24T19:42:21.448Z","0.3.2-lcbeta8":"2019-01-24T19:46:38.426Z","0.3.2-lcbeta9":"2019-01-25T09:52:29.138Z","0.3.2-lcbeta10":"2019-01-25T10:38:42.642Z","0.3.2-lcbeta11":"2019-01-25T10:43:14.242Z","0.3.2-lcbeta12":"2019-01-25T11:08:23.073Z","0.3.2-lcbeta13":"2019-01-25T11:10:33.161Z","0.3.2-lcbeta14":"2019-01-25T11:12:40.618Z","0.3.2-lcbeta15":"2019-01-25T11:14:11.600Z","0.3.2-lcbeta16":"2019-01-25T14:08:13.333Z","0.3.2-lcbeta17":"2019-01-25T14:51:10.804Z","0.3.2-lcbeta18":"2019-01-25T15:12:29.713Z","0.3.2-lcbeta19":"2019-01-25T18:56:20.248Z","0.3.2-lcbeta20":"2019-01-28T13:11:36.192Z","0.3.2-lcbeta21":"2019-01-28T14:19:40.343Z","0.3.2-lcbeta22":"2019-01-29T13:42:02.724Z","0.3.2-lcbeta23":"2019-01-29T13:49:27.954Z","0.2.2-lcbeta1":"2019-01-31T09:49:37.111Z","0.2.2-lcbeta2":"2019-01-31T09:51:47.143Z","0.3.2":"2019-01-31T16:06:03.837Z"},"maintainers":[{"email":"xavarques@gmail.com","name":"xarques"},{"email":"clement0bresson@gmail.com","name":"clementbresson"},{"email":"npm@bernardle.com","name":"fhou"},{"email":"ironic51@gmail.com","name":"nicolaschenet"},{"email":"delwiv@gmail.com","name":"delwiv"},{"email":"cyril@oyst.com","name":"liryc"}],"description":"Authentication library for Azure AD B2C and ReactJS","homepage":"https://github.com/JamesRandall/react-azure-adb2c#readme","keywords":["react","js","AAD","B2C","oauth","azure"],"repository":{"type":"git","url":"git+https://github.com/jamesrandall/react-azure-adb2c.git"},"author":{"name":"Cyril HAGEGE"},"bugs":{"url":"https://github.com/JamesRandall/react-azure-adb2c/issues"},"license":"MIT","readme":"# README\n\nAzure AD B2C is a cost effective identity provider covering social and enterprise logins but it can be awekward to integrate with - its documentation is currently not great and using it involves rooting around across multiple samples, the ADAL library, and the MSAL library.\n\nThat being the case I've focused this package on B2C although with minor changes it could be used more broadly. MSAL itself, which this library wraps, is rather generic but B2C has some specific requirements and I think half of the problem with the documentation is that you end up drifting across B2C and straight AD. I wanted to make things simpler for B2C.\n\nHopefully this will help people writing React apps. It makes use of MSAL underneath and the core of it (other than protecting routes) will probably work with other frameworks too but I use React at the moment. As it's an SPA my assumption in the library and documentation below is that you ultimately want to get an access token that you can use to call remote APIs. See this [Azure AD B2C post here](https://docs.microsoft.com/en-us/azure/active-directory-b2c/active-directory-b2c-access-tokens) for details on how to set this up on the B2C side.\n\nPRs welcome!\n\n## Installation\n\nIf you are using npm:\n\n    npm install react-azure-adb2c --save\n\nOr if you are using yarn:\n\n    yarn add react-azure-adb2c\n\n## Initializing the Library\n\nYou'll first need to load the module and pass some configuration to the library. Normally this would go in your index.js file:\n\n    import authentication from 'react-azure-adb2c';\n    authentication.initialize({\n        // optional, will default to this\n        instance: 'https://login.microsoftonline.com/tfp/', \n        // your B2C tenant\n        tenant: 'myb2ctenant.onmicrosoft.com',\n        // the policy to use to sign in, can also be a sign up or sign in policy\n        signInPolicy: 'mysigninpolicy',\n        // the policy to use for password reset\n        resetPolicy: 'mypasswordresetpolicy',\n        // the the B2C application you want to authenticate with (that's just a random GUID - get yours from the portal)\n        applicationId: '75ee2b43-ad2c-4366-9b8f-84b7d19d776e',\n        // where MSAL will store state - localStorage or sessionStorage\n        cacheLocation: 'sessionStorage',\n        // the scopes you want included in the access token\n        scopes: ['https://myb2ctenant.onmicrosoft.com/management/admin'],\n        // optional, the redirect URI - if not specified MSAL will pick up the location from window.href\n        redirectUri: 'http://localhost:3000',\n        // optional, the URI to redirect to after logout\n        postLogoutRedirectUri: 'http://myapp.com'\n    });\n    \n## Authenticating When The App Starts\n\nIf you want to set things up so that a user is authenticated as soon as they hit your app (for example if you've got a link to an app from a landing page) then, in index.js, wrap the lines of code that launch the React app with the _authentication.run_ function:\n\n    authentication.run(() => {\n      ReactDOM.render(<App />, document.getElementById('root'));\n      registerServiceWorker();  \n    });\n\n## Triggering Authentication Based on Components Mounting (and routing)\n\nIf you want to set things up so that a user is authenticated as they visit a part of the application that requires authentication then the appropriate components can be wrapped inside higher order components that will handle the authentication process. This is done using the _authentication.required_ function, normally in conjunction with a router. The example below shows this using the popular react-router:\n\n    import React, { Component } from 'react';\n    import authentication from 'react-azure-adb2c'\n    import { BrowserRouter as Router, Route, Switch } from \"react-router-dom\";\n    import HomePage from './Homepage'\n    import MembersArea from './MembersArea'\n    \n    class App extends Component {\n      render() {\n        return (\n          <Router basename={process.env.PUBLIC_URL}>\n            <Switch>\n              <Route exact path=\"/\" component={HomePage} />\n              <Route exact path=\"/membersArea\" component={authentication.required(MembersArea)}>\n            </Switch>\n          </Router>\n        );\n      }\n    }\n\n## Getting the Access Token\n\nSimply call the method _getAccessToken_:\n\n    import authentication from 'react-azure-adb2c'\n\n    // ...\n\n    const token = authentication.getAccessToken();\n\n## Signing Out\n\nTo sign out:\n\n    import authentication from 'react-azure-adb2c'\n\n    // ...\n\n    authentication.signOut();\n\n## Thanks\n\nTo build this I made use of the B2C site, the [MSAL library docs](https://github.com/AzureAD/microsoft-authentication-library-for-js), the [react-adal source](https://github.com/salvoravida/react-adal) and this [React MSAL sample](https://github.com/sunilbandla/react-msal-sample). Thanks!\n","readmeFilename":"README.md"}