Skip to content

Commit 6772e0d

Browse files
Merge pull request #168 from microsoftgraph/dev
Merging dev to master
2 parents 440b1f4 + 55e155a commit 6772e0d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+5980
-1069
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ samples/node/secrets.json
2222
samples/browser/src/secrets.js
2323
samples/browser/src/graph-js-sdk-core.js
2424
samples/browser/src/graph-js-sdk-web.js
25+
samples/browser/src/graph-es-sdk.js
2526

2627
spec/**/*.js
2728
spec/**/*.d.ts

.npmignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
src/
1+
src/
2+
scripts/

.prettierignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
lib/
22

3+
scripts/**/*
4+
35
src/**/*.js
46
src/**/*.js.map
57
src/**/*.d.ts
68

79
spec/**/*.js
810
spec/**/*.js.map
9-
spec/**/*.d.ts
11+
spec/**/*.d.ts

README.md

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -60,13 +60,17 @@ Refer devDependencies in [package.json](./package.json) for the compatible msal
6060
```
6161

6262
```typescript
63-
const clientID = "your_client_id"; // Client Id of the registered application
64-
const graphScopes = ["user.read", "mail.send"]; // An array of graph scopes
63+
const clientId = "your_client_id"; // Client Id of the registered application
64+
const callback = (errorDesc, token, error, tokenType) => {};
65+
// An Optional options for initializing the MSAL @see https://github.com/AzureAD/microsoft-authentication-library-for-js/wiki/MSAL-basics#configuration-options
6566
const options = {
66-
// An Optional options for initializing the MSAL @see https://github.com/AzureAD/microsoft-authentication-library-for-js/wiki/MSAL-basics#configuration-options
6767
redirectUri: "Your redirect URI",
6868
};
69-
const authProvider = new MicrosoftGraph.MSALAuthenticationProvider(clientId, graphScopes, options);
69+
const graphScopes = ["user.read", "mail.send"]; // An array of graph scopes
70+
71+
// Initialize the MSAL @see https://github.com/AzureAD/microsoft-authentication-library-for-js/wiki/MSAL-basics#initialization-of-msal
72+
const userAgentApplication = new Msal.UserAgentApplication(clientId, undefined, callback, options);
73+
const authProvider = new MicrosoftGraph.MSALAuthenticationProvider(userAgentApplication, graphScopes);
7074
```
7175

7276
#### Creating an instance of MSALAuthenticationProvider in node environment
@@ -78,15 +82,21 @@ npm install msal@<version>
7882
```
7983

8084
```typescript
85+
import { UserAgentApplication } from "msal";
86+
8187
import { MSALAuthenticationProvider } from "./node_modules/@microsoft/microsoft-graph-client/lib/src/MSALAuthenticationProvider";
8288

8389
const clientId = "your_client_id"; // Client Id of the registered application
84-
const graphScopes = ["user.read", "mail.send"]; // An array of graph scopes
90+
const callback = (errorDesc, token, error, tokenType) => {};
91+
// An Optional options for initializing the MSAL @see https://github.com/AzureAD/microsoft-authentication-library-for-js/wiki/MSAL-basics#configuration-options
8592
const options = {
86-
// An Optional options for initializing the MSAL @see https://github.com/AzureAD/microsoft-authentication-library-for-js/wiki/MSAL-basics#configuration-options
8793
redirectUri: "Your redirect URI",
8894
};
89-
const authProvider = new MSALAuthenticationProvider(clientId, scopes, options);
95+
const graphScopes = ["user.read", "mail.send"]; // An array of graph scopes
96+
97+
// Initialize the MSAL @see https://github.com/AzureAD/microsoft-authentication-library-for-js/wiki/MSAL-basics#initialization-of-msal
98+
const userAgentApplication = new UserAgentApplication(clientId, undefined, callback, options);
99+
const authProvider = new MSALAuthenticationProvider(userAgentApplication, scopes);
90100
```
91101

92102
User can integrate own preferred authentication library by implementing `IAuthenticationProvider` interface. Refer implementing [Custom Authentication Provider](./docs/CustomAuthenticationProvider.md).

browser-wrapper-dependency.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,4 @@
88
/**
99
* Initializes PolyFilling
1010
*/
11-
const PolyFill = require("./lib/src/PolyFill");
12-
PolyFill.init();
11+
require("./lib/src/PolyFill");

0 commit comments

Comments
 (0)