-
Notifications
You must be signed in to change notification settings - Fork 2.7k
[msal-node] Update silent flow sample UI #1888
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 8 commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
528b8ae
Add auth code fallback to silent flow sample
hectormmg 1788430
Add samples cache files to gitignore
hectormmg cf31bf7
Improve the node silent flow sample with handlebars template for a dy…
hectormmg 891e0cc
Merge dev
hectormmg f6981f0
Merge branch 'dev' into node-silent-samples
hectormmg 3e2b25e
Refactor node silent sample views using handlebars layout and templat…
hectormmg e075069
Merge branch 'node-silent-samples' of github.com:AzureAD/microsoft-au…
hectormmg 0ba6e4c
Merge branch 'dev' into node-silent-samples
hectormmg 53325e2
Update msal-node-samples inner directory names
hectormmg 2d76d64
Replace node fetch with axios
hectormmg 8977f7a
Update silent sample UI to display complete graph response on a side …
hectormmg 458db60
Remove array braces around silent sample redirect uri string
hectormmg 7e7e811
Merge branch 'node-silent-samples' of github.com:AzureAD/microsoft-au…
hectormmg 6b614ae
Revert examples.cache.json to example cache
hectormmg 0a04662
Merge branch 'dev' into node-silent-samples
hectormmg File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -266,3 +266,4 @@ lib/msal-core/lib-es6 | |
*.tgz | ||
*.zip | ||
samples/**/test/screenshots | ||
samples/**/data/cache.json |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -70,4 +70,4 @@ | |
"client_id": "mock_client_id" | ||
} | ||
} | ||
} | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
const fetch = require('node-fetch'); | ||
|
||
module.exports = { | ||
callMSGraph: function(endpoint, accessToken, callback) { | ||
const headers = new fetch.Headers(); | ||
const bearer = `Bearer ${accessToken}`; | ||
|
||
headers.append("Authorization", bearer); | ||
|
||
const options = { | ||
method: "GET", | ||
headers: headers | ||
}; | ||
|
||
console.log('request made to Graph API at: ' + new Date().toString()); | ||
|
||
fetch(endpoint, options) | ||
.then(response => response.json()) | ||
.then(response => callback(response, endpoint)) | ||
.catch(error => console.log(error)); | ||
}, | ||
|
||
buildGraphProfile: function(graphResponse) { | ||
return { | ||
name: graphResponse.displayName, | ||
title: graphResponse.jobTitle, | ||
mail: graphResponse.mail, | ||
phone: graphResponse.businessPhones[0], | ||
location: graphResponse.officeLocation | ||
} | ||
} | ||
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.