You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The MSAL library preview for JavaScript enables Single Page Applications to authenticate users with Microsoft Azure Active Directory (AAD) accounts, Microsoft accounts (MSA), accounts in social identity providers like Facebook, Google, LinkedIn etc. and get access to [Microsoft Cloud](https://cloud.microsoft.com) services such as [Microsoft Graph](https://developer.microsoft.com/en-us/graph).
8
9
9
-
The MSAL library preview for JavaScript enables your app to authorize enterprise users using Microsoft Azure Active Directory (AAD), Microsoft account users (MSA), users using social identity providers like Facebook, Google, LinkedIn etc. and get access to [Microsoft Cloud](https://cloud.microsoft.com) OR [Microsoft Graph](https://graph.microsoft.io).
10
-
11
-
The identity management services that the library interacts with are [Microsoft Azure Active Directory](https://azure.microsoft.com/en-us/services/active-directory/), [Microsoft Azure B2C](https://azure.microsoft.com/services/active-directory-b2c/) and [Microsoft Accounts](https://account.microsoft.com).
10
+
The identity management services that the library interacts with are [Microsoft Azure Active Directory](https://azure.microsoft.com/en-us/services/active-directory/), [Microsoft Azure AD B2C](https://azure.microsoft.com/services/active-directory-b2c/) and [Microsoft Accounts](https://account.microsoft.com).
This 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.
18
17
18
+
## Libraries
19
+
Microsoft Authentication Library provides 3 libraries as separate packages. You can read more details about them in the [MSAL Wiki](https://github.com/AzureAD/microsoft-authentication-library-for-js/wiki).
20
+
21
+
-[Microsoft Authentication Library for JavaScript](lib/msal-core/README.md) :
22
+
The core library which can be used in any JavaScript web application.
23
+
24
+
-[Microsoft Authentication Library for Angular](lib/msal-angular/README.md) :
25
+
A wrapper of the core library to support apps using Angular framework.
26
+
27
+
-[Microsoft Authentication Library for AngularJS](lib/msal-angularjs/README.md) :
28
+
A wrapper of the core library to support apps using AngularJS framework.
19
29
20
-
## Example
21
-
This example shows how to acquire a token to read user information from Microsoft Graph.
22
-
1. Register an application in Azure AD v2.0 (using the [application registration portal](https://apps.dev.microsoft.com/)) to get your client_id. you will also need to add the Web platform, check the "Implicit Flow" checkbox, and add the redirectURI to your application.
23
-
2. Instantiate a UserAgentApplication and login the user:
24
-
```JavaScript
25
-
<script class="pre">
26
-
var applicationConfig = {
27
-
clientID:'your_client_id',
28
-
graphScopes: ["user.read", "mail.send"]
29
-
};
30
-
31
-
var logger =newMsal.Logger(loggerCallback, { level:Msal.LogLevel.Verbose, correlationId:'12345' }); // level and correlationId are optional parameters.
32
-
//Logger has other optional parameters like piiLoggingEnabled which can be assigned as shown aabove. Please refer to the docs to see the full list and their default values.
var userAgentApplication =newMsal.UserAgentApplication(applicationConfig.clientID, null, authCallback, { logger: logger, cacheLocation:'localStorage'}); //logger and cacheLocation are optional parameters.
39
-
//userAgentApplication has other optional parameters like redirectUri which can be assigned as shown above.Please refer to the docs to see the full list and their default values.
4. use the token in an [HTTP bearer request](https://github.com/Azure-Samples/active-directory-javascript-singlepageapp-dotnet-webapi-v2/blob/master/TodoSPA/App/Scripts/Ctrls/todoListCtrl.js#L30), to call the Microsoft Graph or a Web API
72
-
73
-
## Installation
74
-
75
-
Via NPM:
76
-
77
-
npm install msal
78
-
79
-
Note that msal.js is built for ES5, therefore enabling support of Internet Explorer 11. If you want to target Internet Explorer, you'll need to add a reference to promises polyfill. You might want to read more in the [FAQ](../../wiki)
80
-
```JavaScript
81
-
<!--IE support: add promises polyfill before msal.js-->
If you want to build the library and run all the unit tests, you can do the following.
88
-
89
-
First navigate to the root directory of the library and install the dependencies:
90
-
91
-
npm install
92
-
93
-
Then use the following command to build the library and run all the unit tests:
94
-
95
-
npm run build
96
-
97
-
## Logging
98
-
99
-
You can enable logging in MSAL.js by passing a logger object when creating a UserAgentApplication instance as follows:
100
-
```javascript
101
-
var logger =newMsal.Logger(loggerCallback, { level:Msal.LogLevel.Verbose });
102
-
103
-
var clientApplication =newMsal.UserAgentApplication(clientID, authority, authCallback, { logger: logger });
104
-
105
-
```
106
-
Implement the `loggerCallback` method depending on how you want to redirect logs.
107
-
The supported log levels are: Error, Warning, Info, Verbose
108
-
109
-
#### Personal Identifiable Information (PII) & Organizational Identifiable Information (OII)
110
-
111
-
By default, MSAL.js logging does not capture or log any PII or OII. The library allows app developers to turn this on by configuring the `piiLoggingEnabled` flag on the log context. By turning on PII or OII, the app takes responsibility for safely handling highly-sensitive data and complying with any regulatory requirements.
112
-
113
-
```javascript
114
-
//PII or OII logging disabled. Default Logger does not capture any PII or OII
115
-
var logger =newMsal.Logger(loggerCallback, { level:Msal.LogLevel.Verbose, piiLoggingEnabled:false });
116
-
117
-
//PII or OII logging enabled
118
-
var logger =newMsal.Logger(loggerCallback, { level:Msal.LogLevel.Verbose, piiLoggingEnabled:true });
119
-
120
-
```
121
30
## Community Help and Support
122
31
123
-
-[FAQ](../../wiki) for access to our frequently asked questions
32
+
-[FAQs](https://github.com/AzureAD/microsoft-authentication-library-for-js/wiki/FAQs) for access to our frequently asked questions
124
33
125
-
-[Stack Overflow](http://stackoverflow.com/questions/tagged/msal) using tag MSAL.
126
-
We highly recommend you ask your questions on Stack Overflow first and browse existing issues to see if someone has asked your question before.
34
+
-[Stack Overflow](http://stackoverflow.com/questions/tagged/msal) using "msal" and "msal.js" tag.
35
+
We highly recommend you ask your questions on Stack Overflow first and browse existing issues to see if someone has asked your question before.
127
36
128
-
-[GitHub Issues](../../issues) for reporting an bug or feature requests
37
+
-[GitHub Issues](../../issues) for reporting a bug or feature requests
129
38
130
39
-[User Voice page](https://feedback.azure.com/forums/169401-azure-active-directory) to provide recommendations and/or feedback
131
40
132
41
## Contribute
133
42
134
-
We enthusiastically welcome contributions and feedback. You can clone the repo and start contributing now.
135
-
136
-
This 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 [[email protected]](mailto:[email protected]) with any additional questions or comments.
43
+
We enthusiastically welcome contributions and feedback. Please read the [contributing guide](contributing.md) before you begin.
137
44
138
45
## Security Library
139
46
@@ -143,11 +50,6 @@ This library controls how users sign-in and access services. We recommend you al
143
50
144
51
If you find a security issue with our libraries or services please report it to [[email protected]](mailto:[email protected]) 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.
145
52
146
-
147
-
Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT License (the "License");
148
-
149
-
150
-
151
53
## License
152
54
153
55
Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT License (the "License");
Now decide if you want your feature or bug fix to go into the dev branch
26
+
or the master branch. **All bug fixes and new features should go into the dev branch.**
27
+
28
+
The master branch is effectively frozen; patches that change the SDKs
29
+
protocols or API surface area or affect the run-time behavior of the SDK will be rejected.
30
+
31
+
Some of our SDKs have bundled dependencies that are not part of the project proper. Any changes to files in those directories or its subdirectories should be sent to their respective
32
+
projects. Do not send your patch to us, we cannot accept it.
33
+
34
+
In case of doubt, open an issue in the [issue tracker][].
35
+
36
+
Especially do so if you plan to work on a major change in functionality. Nothing is more
37
+
frustrating than seeing your hard work go to waste because your vision
38
+
does not align with our goals for the SDK.
39
+
40
+
41
+
### BRANCH
42
+
43
+
Okay, so you have decided on the proper branch. Create a feature branch
0 commit comments