{"bugs":{"url":"https://github.com/AzureAD/microsoft-authentication-library-for-js/issues"},"dist":{"shasum":"288d9ee8e7413677e086ee7fddc7d8902af7b4dd","tarball":"https://registry.npmjs.org/msal/-/msal-1.0.0-preview.2.tgz","fileCount":261,"integrity":"sha512-V3R3Fih5Z0WULhCUrGiZdvqtT76LHJw1Ogv7TTvDPkqUEJuxTPXmAm8okq+8bs+Fsf3Zkbpn87GgOxD1GVdrrQ==","signatures":[{"sig":"MEQCIGo3LELx8wLJx/pmRtjiRMLQBrnsiI9JN2euxxGZWDNHAiBsgK6zyz0oApvv5y8mxfNc4QjjiTLK7zQ85EsPH6uPtA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":2171793,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcvqI8CRA9TVsSAnZWagAATIsP/3sDSEugyAESqLtEDHk3\n7yWH3zglDRfad5gTIfzKTCmJIQPPgR8vpdmI44M9cCNR4PVB4kTzWu0gCVJ2\nyHpwWNDMJfwNpbAGBpthcf6ly8NijlM8p+jR94r3abJ1o3lQ6hnwIKDobcQs\nRM7QC+HPs3EBHabmvE9Hev4fCvljIVCMXjdIEAQGimDCOeXjt8rWTfjQN/So\nl2QEA+FHX4I+dlvGsRydQ6Htku+Hrz59r3nWlcxuaX0Uw78ZIDbNbnY/BIfG\ngfe+Z5XO7CpmL4uGEPWp06tZfTTvHkXKEa65tjBSbaJ/16f2qYsGnOMGx24P\nehn3i518/0G5evuvWVptkB1eyUEEjTTL74I67QBAPOuoHlz7NLY9gmf4Dlab\n1QGcgawpJ/dXNAqi1vwW8h7CHyEExY1CTrv6PwQjGEWb5MHmvxZf/6HlszZX\nr9hTpsIQOKrpvfrg2OGPgECfKNdeOY71rKaNqp715zCTivQHcQH6ZYyM7EKt\nMfj8xReV2PPlP20oJVTHPRobbZpmoA8IW6Tzfc5tlciArQsRVnSsBBW/XI8t\nY69qUwrV//Imw3NX0dfcbdROeVfva3J+p/pnPwz/OMKsn8GIYN2wXs7P+qOb\nvlrFKwWrSZN7xbOnLYqT0pPX9LvbAcE4f6MJa9oMwkYiApKISbJ3DLe+JSBi\n/dN7\r\n=mcnE\r\n-----END PGP SIGNATURE-----\r\n"},"main":"./lib-commonjs/index.js","name":"msal","types":"./lib-commonjs/index.d.ts","author":{"url":"https://www.microsoft.com","name":"Microsoft","email":"nugetaad@microsoft.com"},"module":"./lib-es6/index.js","readme":"\nMicrosoft Authentication Library Preview for JavaScript (MSAL.js)\n=========================================================\n\n| [Getting Started](https://docs.microsoft.com/en-us/azure/active-directory/develop/guidedsetups/active-directory-javascriptspa)| [Docs](https://aka.ms/aaddevv2) | [Library Reference](https://htmlpreview.github.io/?https://raw.githubusercontent.com/AzureAD/microsoft-authentication-library-for-js/blob/dev/docs/classes/_useragentapplication_.useragentapplication.html) | [Support](README.md#community-help-and-support) | [Samples](https://github.com/AzureAD/microsoft-authentication-library-for-js/wiki/Samples)\n| --- | --- | --- | --- | --- |\n\n\nThe MSAL library preview for JavaScript enables client-side JavaScript web applications running in a web browser to authenticate users using [Azure AD](https://docs.microsoft.com/en-us/azure/active-directory/develop/v2-overview) work and school accounts (AAD), Microsoft personal accounts (MSA) and social identity providers like Facebook, Google, LinkedIn, Microsoft accounts, etc. through [Azure AD B2C](https://docs.microsoft.com/en-us/azure/active-directory-b2c/active-directory-b2c-overview#identity-providers) service. It also enables your app to get tokens to access [Microsoft Cloud](https://cloud.microsoft.com) services such as [Microsoft Graph](https://graph.microsoft.io).\n\n[![Build Status](https://travis-ci.org/AzureAD/microsoft-authentication-library-for-js.png?branch=dev)](https://travis-ci.org/AzureAD/microsoft-authentication-library-for-js)[![npm version](https://img.shields.io/npm/v/msal.svg?style=flat)](https://www.npmjs.com/package/msal)[![npm version](https://img.shields.io/npm/dm/msal.svg)](https://nodei.co/npm/msal/)\n\n\n## Important Note about the MSAL Preview\nThe MSAL.js core library is suitable for use in a production environment. We provide the same production level support for this library as we do our current production libraries. During the preview we may make changes to the API, internal cache format, and other mechanisms of this library, which you will be required to take along with bug fixes or feature improvements. This may impact your application. For instance, a change to the cache format may impact your users, such as requiring them to sign in again. An API change may require you to update your code. When we provide the General Availability release we will require you to update to the General Availability version within six months, as applications written using a preview version of library may no longer work.\n\n## Installation\nVia NPM:\n\n    npm install msal\n\nVia CDN:\n\n    <!-- Latest compiled and minified JavaScript -->\n    <script src=\"https://secure.aadcdn.microsoftonline-p.com/lib/<version>/js/msal.js\"></script>\n    <script src=\"https://secure.aadcdn.microsoftonline-p.com/lib/<version>/js/msal.min.js\"></script>\n\nNote that msal.js is built for ES5, therefore enabling support for Internet Explorer 11. If you want to target Internet Explorer, you'll need to add a reference to promises polyfill.\n\n    <!-- IE support: add promises polyfill before msal.js  -->\n    <script src=\"https://cdnjs.cloudflare.com/ajax/libs/bluebird/3.3.4/bluebird.min.js\" class=\"pre\"></script>\n\nSee here for more details on [supported browsers](https://github.com/AzureAD/microsoft-authentication-library-for-js/wiki/FAQs#q4-what-browsers-is-msaljs-supported-on).\n\n## Usage\nThe example snippets below show how to acquire a token for Microsoft Graph.\n\n#### Prerequisite\n\nBefore using MSAL.js, [register an application in Azure AD](https://docs.microsoft.com/en-us/azure/active-directory/develop/quickstart-register-app) to get your clientID.\n\n#### 1. Instantiate the UserAgentApplication\n\nInstantiate the UserAgentApplication with a minimal required configuration of clientID.   \n\nA callback function must be passed in for the redirect flows(loginRedirect and acquireTokenRedirect). This callback function is called after the authentication request is completed either successfully or with a failure. This is not required for the popup flows since they return promises.\n\nUserAgentApplication has other optional parameters like redirectUri which can be assigned. Please refer to the [Wiki](https://github.com/AzureAD/microsoft-authentication-library-for-js/wiki/MSAL-basics#configuration-options) to see the full list and their default values.\n\n```JavaScript\n    var applicationConfig = {\n        clientID: 'your_client_id'\n    };\n\n     var userAgentApplication = new Msal.UserAgentApplication(applicationConfig.clientID, null, tokenReceivedCallback);\n\n    //callback function for redirect flows\n    function tokenReceivedCallback(errorDesc, token, error, tokenType) {\n        if (token) {\n        }\n        else {\n            log(error + \":\" + errorDesc);\n        }\n    }\n```\n\n#### 2. Login the user\n\nYour app must login the user with either loginPopup or the loginRedirect method to establish user context. When the login methods are called and the authentication of the user is completed by the Azure AD service, an [id token](https://docs.microsoft.com/en-us/azure/active-directory/develop/id-tokens) is returned which is used to identify the user with some basic information.\n\n```JavaScript\n   var graphScopes = [\"user.read\", \"mail.send\"];\n\n   userAgentApplication.loginPopup(graphScopes).then(function (idToken) {\n       //login success\n   }, function (error) {\n       //login failure\n       console.log(error);\n   });\n\n```\n> Note: The scopes passed to the login method are optional. In this example, the graphScopes are passed in the login method to obtain consent upfront from the user for your app to access certain Graph API scopes. The idtoken returned here does not contain the scopes. In the next step, you can see how to get an access token which will contain the consented scopes.\n\n#### 3. Get an access token to call an API\n\nIn MSAL, you can get access tokens for the APIs your app needs to call using the acquireTokenSilent method which makes a silent request(without prompting the user) to Azure AD to obtain an access token. The Azure AD service then returns an [access token](https://docs.microsoft.com/en-us/azure/active-directory/develop/access-tokens) containing the user consented scopes to allow your app to securely call the API.  \n\nIf the silent token acquisition fails for some reasons such as an expired token or password change, you will need to invoke an interactive method to acquire tokens such as acquireTokenPopup or acquireTokenRedirect.\n\n ```JavaScript\n    var graphScopes = [\"user.read\", \"mail.send\"];\n\n    userAgentApplication.loginPopup(graphScopes).then(function (idToken) {\n        //Login Success\n        userAgentApplication.acquireTokenSilent(graphScopes).then(function (accessToken) {\n            //AcquireTokenSilent Success\n        }, function (error) {\n            //AcquireTokenSilent Failure, send an interactive request.\n            userAgentApplication.acquireTokenPopup(graphScopes).then(function (accessToken) {\n                updateUI();\n            }, function (error) {\n                console.log(error);\n            });\n        })\n    }, function (error) {\n        //login failure\n        console.log(error);\n    });\n```\n\n#### 4. Use the token as a bearer in an HTTP request to call the Microsoft Graph or a Web API\n\n```JavaScript\n    var headers = new Headers();\n    var bearer = \"Bearer \" + token;\n    headers.append(\"Authorization\", bearer);\n    var options = {\n         method: \"GET\",\n         headers: headers\n    };\n    var graphEndpoint = \"https://graph.microsoft.com/v1.0/me\";\n\n    fetch(graphEndpoint, options)\n        .then(function (response) {\n             //do something with response\n        }\n```\n\nYou can learn further details about MSAL.js functionality documented in the [MSAL Wiki](https://github.com/AzureAD/microsoft-authentication-library-for-js/wiki) and find complete [code samples](https://github.com/AzureAD/microsoft-authentication-library-for-js/wiki/Samples).\n\n## Community Help and Support\n\n- [FAQs](https://github.com/AzureAD/microsoft-authentication-library-for-js/wiki/FAQs) for access to our frequently asked questions\n\n- [Stack Overflow](http://stackoverflow.com/questions/tagged/msal) using \"msal\" and \"msal.js\" tag.\n\nWe highly recommend you ask your questions on Stack Overflow first and browse existing issues to see if someone has asked your question before.\n\n- [GitHub Issues](../../issues) for reporting a bug or feature requests\n\n- [User Voice page](https://feedback.azure.com/forums/169401-azure-active-directory) to provide recommendations and/or feedback\n\n## Contribute\n\nWe enthusiastically welcome contributions and feedback. Please read the [contributing guide](contributing.md) before you begin.\n\n## Security Library\n\nThis library controls how users sign-in and access services. We recommend you always take the latest version of our library in your app when possible. We use [semantic versioning](http://semver.org) so you can control the risk associated with updating your app. As an example, always downloading the latest minor version number (e.g. x.*y*.x) ensures you get the latest security and feature enhanements but our API surface remains the same. You can always see the latest version and release notes under the Releases tab of GitHub.\n\n## Security Reporting\n\nIf you find a security issue with our libraries or services please report it to [secure@microsoft.com](mailto:secure@microsoft.com) with as much detail as possible. Your submission may be eligible for a bounty through the [Microsoft Bounty](http://aka.ms/bugbounty) program. Please do not post security issues to GitHub Issues or any other public site. We will contact you shortly upon receiving the information. We encourage you to get notifications of when security incidents occur by visiting [this page](https://technet.microsoft.com/en-us/security/dd252948) and subscribing to Security Advisory Alerts.\n\n## License\n\nCopyright (c) Microsoft Corporation.  All rights reserved. Licensed under the MIT License (the \"License\");\n\n## We Value and Adhere to the Microsoft Open Source Code of Conduct\n\nThis project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.\n","engines":{"node":">=0.8.0"},"license":"MIT","scripts":{"doc":"typedoc --out ./docs ./src/ --gitRevision dev","lint":"tslint -c tslint.json src/**/*.ts","test":"karma start --single-run --browsers PhantomJS karma.conf.js","build":"npm run clean && npm run doc && npm run build:modules && npm run lint && npm run build:webpack && npm test","clean":"shx rm -rf dist docs lib-commonjs lib-es6","build:modules":"tsc && tsc -m es6 --outDir lib-es6","build:webpack":"webpack"},"_npmUser":{"name":"azuread","email":"nugetaad@microsoft.com"},"homepage":"https://github.com/AzureAD/microsoft-authentication-library-for-js#readme","keywords":["implicit","js","AAD","msal","oauth"],"deprecated":"This package is no longer supported. Please use @azure/msal-browser instead.","repository":{"url":"git+https://github.com/AzureAD/microsoft-authentication-library-for-js.git","type":"git"},"_npmVersion":"6.4.1","description":"Microsoft Authentication Library for js","directories":{"test":"test"},"maintainers":[{"name":"azuread","email":"nugetaad@microsoft.com"}],"_nodeVersion":"10.15.1","dependencies":{"atob":"~2.1.1","tslib":"^1.9.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ajv":"6.6.1","shx":"^0.2.2","chai":"^4.2.0","husky":"^1.3.1","jsdom":"14.0.0","karma":"^4.0.1","mocha":"^6.1.3","sinon":"^7.3.1","jshint":"^2.9.7","tslint":"^5.8.0","js-yaml":"^3.13.1","ts-node":"^8.0.3","typedoc":"^0.14.2","webpack":"^4.27.1","karma-cli":"^1.0.1","ts-loader":"^5.3.1","handlebars":"^4.1.2","karma-chai":"^0.1.0","typescript":"^3.2.1","@types/chai":"^4.1.7","@types/node":"^11.11.5","karma-mocha":"^1.3.0","webpack-cli":"^3.2.3","@types/mocha":"^5.2.6","@types/sinon":"^7.0.11","jsdom-global":"3.0.2","karma-webpack":"^4.0.0-rc.5","babel-polyfill":"^6.26.0","karma-typescript":"^4.0.0","@types/handlebars":"4.0.33","phantomjs-polyfill":"0.0.2","karma-spec-reporter":"0.0.32","karma-mocha-reporter":"^2.2.5","karma-remap-coverage":"^0.1.5","karma-remap-istanbul":"^0.6.0","karma-chrome-launcher":"^2.2.0","karma-firefox-launcher":"^0.1.7","karma-sourcemap-loader":"^0.3.7","karma-verbose-reporter":"0.0.6","webpack-dev-middleware":"^3.4.0","uglifyjs-webpack-plugin":"^2.1.1","karma-phantomjs-launcher":"*","awesome-typescript-loader":"^3.2.3","istanbul-instrumenter-loader":"^3.0.1","fork-ts-checker-webpack-plugin":"^0.5.1","karma-coverage-istanbul-reporter":"^2.0.1","sourcemap-istanbul-instrumenter-loader":"^0.2.0"},"_npmOperationalInternal":{"tmp":"tmp/msal_1.0.0-preview.2_1555997244166_0.5831794434701205","host":"s3://npm-registry-packages"},"_id":"msal@1.0.0-preview.2","version":"1.0.0-preview.2"}