Skip to content

Commit bcb1cf6

Browse files
authored
Merge pull request #14 from andrewconnell/fy2019q4-refresh
FY2019Q4 Quarterly refresh
2 parents c471f4f + e51918e commit bcb1cf6

File tree

16 files changed

+10589
-21753
lines changed

16 files changed

+10589
-21753
lines changed

02 Create AzureAD Application.pptx

-7.65 KB
Binary file not shown.

README.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,26 @@ If you just want the completed sample generated by following this lab, you can f
2222

2323
- [Completed project](demos/03-add-msgraph)
2424

25+
## Contributors
26+
27+
| Roles | Author(s) |
28+
| ------------------------- | --------------------------------------------------------------------------------------------- |
29+
| Code / Tutorial / Support | Jason Johnston (Microsoft) [@jasonjoh](//github.com/jasonjoh) |
30+
| Slides | Jeremy Thake (Microsoft) [@jthake-msft](//github.com/jthake-msft) |
31+
| QA | Andrew Connell (Microsoft MVP, Voitanos) [@andrewconnell](//github.com/andrewconnell) |
32+
| QA | Julie Turner (Microsoft MVP, Sympraxis Consulting) [@juliemturner](//github.com/juliemturner) |
33+
34+
## Version history
35+
36+
| Version | Date | Comments |
37+
| ------- | ---------------- | ---------------------------------- |
38+
| 1.5 | May 24, 2019 | 2019Q4 content refresh |
39+
| 1.4 | May 22, 2019 | Quickstart updates |
40+
| 1.3 | May 16, 2019 | Updated AAD app registration steps |
41+
| 1.2 | March 6, 2019 | 2019Q3 content refresh |
42+
| 1.1 | February 8, 2019 | Added slides |
43+
| 1.0 | 2018 | Published |
44+
2545
## Disclaimer
2646

2747
**THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.**

demos/01-create-app/graph-tutorial/package-lock.json

Lines changed: 3653 additions & 7067 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

demos/01-create-app/graph-tutorial/package.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,16 @@
33
"version": "0.1.0",
44
"private": true,
55
"dependencies": {
6-
"@fortawesome/fontawesome-free": "^5.7.2",
7-
"@microsoft/microsoft-graph-client": "^1.5.2",
6+
"@fortawesome/fontawesome-free": "^5.8.2",
7+
"@microsoft/microsoft-graph-client": "^1.6.0",
88
"bootstrap": "^4.3.1",
99
"moment": "^2.24.0",
10-
"msal": "^0.2.4",
11-
"react": "^16.8.4",
12-
"react-dom": "^16.8.4",
13-
"react-router-dom": "^4.3.1",
14-
"react-scripts": "2.1.5",
15-
"reactstrap": "^7.1.0"
10+
"msal": "^1.0.0",
11+
"react": "^16.8.6",
12+
"react-dom": "^16.8.6",
13+
"react-router-dom": "^5.0.0",
14+
"react-scripts": "^3.0.1",
15+
"reactstrap": "^8.0.0"
1616
},
1717
"scripts": {
1818
"start": "react-scripts start",

demos/02-add-aad-auth/graph-tutorial/package-lock.json

Lines changed: 3640 additions & 7064 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

demos/02-add-aad-auth/graph-tutorial/package.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,16 @@
33
"version": "0.1.0",
44
"private": true,
55
"dependencies": {
6-
"@fortawesome/fontawesome-free": "^5.7.2",
7-
"@microsoft/microsoft-graph-client": "^1.5.2",
6+
"@fortawesome/fontawesome-free": "^5.8.2",
7+
"@microsoft/microsoft-graph-client": "^1.6.0",
88
"bootstrap": "^4.3.1",
99
"moment": "^2.24.0",
10-
"msal": "^0.2.4",
11-
"react": "^16.8.4",
12-
"react-dom": "^16.8.4",
13-
"react-router-dom": "^4.3.1",
14-
"react-scripts": "2.1.5",
15-
"reactstrap": "^7.1.0"
10+
"msal": "^1.0.0",
11+
"react": "^16.8.6",
12+
"react-dom": "^16.8.6",
13+
"react-router-dom": "^5.0.0",
14+
"react-scripts": "^3.0.1",
15+
"reactstrap": "^8.0.0"
1616
},
1717
"scripts": {
1818
"start": "react-scripts start",

demos/02-add-aad-auth/graph-tutorial/src/App.js

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,17 @@ class App extends Component {
1313
constructor(props) {
1414
super(props);
1515

16-
this.userAgentApplication = new UserAgentApplication(config.appId, null, null);
16+
this.userAgentApplication = new UserAgentApplication({
17+
auth: {
18+
clientId: config.appId
19+
},
20+
cache: {
21+
cacheLocation: "localStorage",
22+
storeAuthStateInCookie: true
23+
}
24+
});
1725

18-
var user = this.userAgentApplication.getUser();
26+
var user = this.userAgentApplication.getAccount();
1927

2028
this.state = {
2129
isAuthenticated: (user !== null),
@@ -65,7 +73,11 @@ class App extends Component {
6573

6674
async login() {
6775
try {
68-
await this.userAgentApplication.loginPopup(config.scopes);
76+
await this.userAgentApplication.loginPopup(
77+
{
78+
scopes: config.scopes,
79+
prompt: "select_account"
80+
});
6981
await this.getUserProfile();
7082
}
7183
catch(err) {
@@ -89,7 +101,9 @@ class App extends Component {
89101
// will just return the cached token. Otherwise, it will
90102
// make a request to the Azure OAuth endpoint to get a token
91103

92-
var accessToken = await this.userAgentApplication.acquireTokenSilent(config.scopes);
104+
var accessToken = await this.userAgentApplication.acquireTokenSilent({
105+
scopes: config.scopes
106+
});
93107

94108
if (accessToken) {
95109
// Get the user's profile from Graph

demos/02-add-aad-auth/graph-tutorial/src/GraphService.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ function getAuthenticatedClient(accessToken) {
66
// Use the provided access token to authenticate
77
// requests
88
authProvider: (done) => {
9-
done(null, accessToken);
9+
done(null, accessToken.accessToken);
1010
}
1111
});
1212

0 commit comments

Comments
 (0)