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
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+27Lines changed: 27 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -106,8 +106,35 @@ To make the contribution process as seamless as possible, follow these steps.
106
106
107
107
You navigate to the repository on your computer by using File Explorer. The repository files are in `C:\Users\<yourusername>\<repo name>`.
108
108
109
+
To install dependencies that are necessary for development run,
110
+
111
+
```cmd
112
+
npm install
113
+
```
114
+
109
115
To edit files, open them in an editor of your choice and modify them. To create a new file, use the editor of your choice and save the new file in the appropriate location in your local copy of the repository. While working, save your work frequently.
110
116
117
+
*Note: Make sure to add unit tests to validate you changes.*
118
+
119
+
Once you have done with your changes, You have to build and test your changes
120
+
To build the library run,
121
+
122
+
```cmd
123
+
npm run build
124
+
```
125
+
126
+
To run tests,
127
+
128
+
```cmd
129
+
npm run test
130
+
```
131
+
132
+
To run linting,
133
+
134
+
```cmd
135
+
npm run lint
136
+
```
137
+
111
138
The files in `C:\Users\<yourusername>\<repo name>` are a working copy of the new branch that you created in your local repository. Changing anything in this folder doesn't affect the local repository until you commit a change. To commit a change to the local repository, type the following commands in GitBash:
Copy file name to clipboardExpand all lines: README.md
+42-27Lines changed: 42 additions & 27 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,24 +16,32 @@ The Microsoft Graph JavaScript client library is a lightweight wrapper around th
16
16
npm install @microsoft/microsoft-graph-client
17
17
```
18
18
19
-
import `@microsoft/microsoft-graph-client` into your module.
19
+
import `@microsoft/microsoft-graph-client` into your module and also you will need polyfills for fetch like [isomorphic-fetch](https://www.npmjs.com/package/isomorphic-fetch).
Incase if your application ships with [es6-promise](https://www.npmjs.com/package/es6-promise) and [isomorphic-fetch](https://www.npmjs.com/package/isomorphic-fetch)just use `lib/graph-js-sdk-core.js`
34
+
In case your browser doesn't have support for [Fetch](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API)[[support](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API#Browser_compatibility)] or [Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)[[support](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise#Browser_compatibility)], you need to use polyfills like [github/fetch](https://github.com/github/fetch)for fetch and [es6-promise](https://github.com/stefanpenner/es6-promise) for promise.
@@ -47,11 +55,11 @@ Register your application to use Microsoft Graph API using one of the following
47
55
48
56
### 2. Authenticate for the Microsoft Graph service
49
57
50
-
The Microsoft Graph JavaScript Client Library has an adapter implementation ([MSALAuthenticationProvider](src/MSALAuthenticationProvider.ts)) for [MSAL](https://github.com/AzureAD/microsoft-authentication-library-for-js/tree/dev/lib/msal-core) (Microsoft Authentication Library) which takes care of getting the `accessToken`. MSAL library does not ship with this library, user has to include it externally (For including MSAL, refer [this](https://github.com/AzureAD/microsoft-authentication-library-for-js/tree/dev/lib/msal-core#installation)).
58
+
The Microsoft Graph JavaScript Client Library has an adapter implementation ([ImplicitMSALAuthenticationProvider](src/ImplicitMSALAuthenticationProvider.ts)) for [MSAL](https://github.com/AzureAD/microsoft-authentication-library-for-js/tree/dev/lib/msal-core) (Microsoft Authentication Library) which takes care of getting the `accessToken`. MSAL library does not ship with this library, user has to include it externally (For including MSAL, refer [this](https://github.com/AzureAD/microsoft-authentication-library-for-js/tree/dev/lib/msal-core#installation)).
51
59
52
-
> **Note:** MSAL is supported only for frontend applications, for server-side authentication you have to implement your own AuthenticationProvider. Refer implementing[Custom Authentication Provider](./docs/CustomAuthenticationProvider.md).
60
+
> **Important Note:** MSAL is supported only for frontend applications, for server-side authentication you have to implement your own AuthenticationProvider. Learn how you can create a[Custom Authentication Provider](./docs/CustomAuthenticationProvider.md).
53
61
54
-
#### Creating an instance of MSALAuthenticationProvider in browser environment
62
+
#### Creating an instance of ImplicitMSALAuthenticationProvider in browser environment
55
63
56
64
Refer devDependencies in [package.json](./package.json) for the compatible msal version and update that version in below.
57
65
@@ -60,20 +68,24 @@ Refer devDependencies in [package.json](./package.json) for the compatible msal
60
68
```
61
69
62
70
```typescript
63
-
const clientId ="your_client_id"; // Client Id of the registered application
// An Optional options for initializing the MSAL @see https://github.com/AzureAD/microsoft-authentication-library-for-js/wiki/MSAL-basics#configuration-options
66
-
const options = {
67
-
redirectUri: "Your redirect URI",
71
+
72
+
// Configuration options for MSAL @see https://github.com/AzureAD/microsoft-authentication-library-for-js/wiki/MSAL.js-1.0.0-api-release#configuration-options
73
+
const msalConfig = {
74
+
auth: {
75
+
clientId: "your_client_id", // Client Id of the registered application
76
+
redirectUri: "your_redirect_uri",
77
+
},
68
78
};
69
79
const graphScopes = ["user.read", "mail.send"]; // An array of graph scopes
70
80
71
-
// Initialize the MSAL @see https://github.com/AzureAD/microsoft-authentication-library-for-js/wiki/MSAL-basics#initialization-of-msal
// An Optional options for initializing the MSAL @see https://github.com/AzureAD/microsoft-authentication-library-for-js/wiki/MSAL-basics#configuration-options
92
-
const options = {
93
-
redirectUri: "Your redirect URI",
102
+
const msalConfig = {
103
+
auth: {
104
+
clientId: "your_client_id", // Client Id of the registered application
105
+
redirectUri: "your_redirect_uri",
106
+
},
94
107
};
95
108
const graphScopes = ["user.read", "mail.send"]; // An array of graph scopes
96
109
97
-
// Initialize the MSAL @see https://github.com/AzureAD/microsoft-authentication-library-for-js/wiki/MSAL-basics#initialization-of-msal
User can integrate own preferred authentication library by implementing `IAuthenticationProvider` interface. Refer implementing [Custom Authentication Provider](./docs/CustomAuthenticationProvider.md).
@@ -193,8 +208,8 @@ Please see the [contributing guidelines](CONTRIBUTING.md).
0 commit comments