Skip to content
This repository has been archived by the owner. It is now read-only.

Commit 74874ce

Browse files
committed
final changes2
1 parent e805e75 commit 74874ce

File tree

8 files changed

+103
-76
lines changed

8 files changed

+103
-76
lines changed

CHANGELOG.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
# CHANGELOG
22

3-
## 2/13/2020
3+
## 2/21/2020
44

55
* Source code refactored.
6+
* Ajax calls replaced with Fetch API.
7+
* Corrected HTML structure.
68
* UI redesigned with Bootstrap 4 framework.
7-
* Added AppCreationScripts for Powershell users.
9+
* Corrected README.md.

JavaScriptSPA/api.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,13 @@ function callApiWithAccessToken(endpoint, accessToken) {
1010
headers: headers
1111
};
1212

13-
console.log('request made to Graph API at: ' + new Date().toString());
13+
console.log('request made to Web API at: ' + new Date().toString());
1414

1515
fetch(endpoint, options)
1616
.then(response => response.json())
1717
.then(response => {
18-
logMessage("Web APi returned:\n" + JSON.stringify(response));
18+
console.log('web API responded at: ' + new Date().toString());
19+
logMessage("web API returned:\n" + JSON.stringify(response));
1920
}).catch(error => {
2021
logMessage("Error calling the Web api:\n" + error);
2122
});

JavaScriptSPA/apiConfig.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// The current application coordinates were pre-registered in a B2C tenant.
2-
var apiConfig = {
2+
const apiConfig = {
33
b2cScopes: ["https://fabrikamb2c.onmicrosoft.com/helloapi/demo.read"],
44
webApi: "https://fabrikamb2chello.azurewebsites.net/hello"
55
};

JavaScriptSPA/auth.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ const myMSALObj = new Msal.UserAgentApplication(msalConfig);
99
function signIn() {
1010
myMSALObj.loginPopup(loginRequest)
1111
.then(loginResponse => {
12-
console.log(loginResponse)
1312
getToken(tokenRequest)
1413
.then(updateUI);
1514
}).catch(error => {

JavaScriptSPA/index.html

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,15 @@
66
<title>AAD B2C | MSAL.JS Vanilla JavaScript SPA</title>
77

88
<!-- bluebird only needed if this page needs to run on Internet Explorer -->
9-
<script src="https://cdnjs.cloudflare.com/ajax/libs/bluebird/3.3.4/bluebird.min.js" class="pre"></script>
9+
<script type="text/javascript" src="//cdn.jsdelivr.net/npm/bluebird@3.7.2/js/browser/bluebird.min.js"></script>
10+
1011
<!-- msal.min.js can be used in the place of msal.js; included msal.js to make debug easy -->
1112
<script type="text/javascript" src="https://alcdn.msftauth.net/lib/1.2.1/js/msal.js" integrity="sha384-9TV1245fz+BaI+VvCjMYL0YDMElLBwNS84v3mY57pXNOt6xcUYch2QLImaTahcOP" crossorigin="anonymous"></script>
12-
13+
14+
<script type="text/javascript">
15+
if(typeof Msal === 'undefined')document.write(unescape("%3Cscript src='https://alcdn.msftauth.net/lib/1.2.1/js/msal.js' type='text/javascript' integrity='sha384-9TV1245fz+BaI+VvCjMYL0YDMElLBwNS84v3mY57pXNOt6xcUYch2QLImaTahcOP' crossorigin='anonymous'%3E%3C/script%3E"));
16+
</script>
17+
1318
<!-- adding Bootstrap 4 for UI components -->
1419
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css" integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh" crossorigin="anonymous">
1520
</head>

JavaScriptSPA/ui.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,5 @@ function updateUI() {
2222
// debug helper
2323
function logMessage(s) {
2424
document.getElementById("response")
25-
.appendChild(document.createTextNode('\n' + s));
25+
.appendChild(document.createTextNode('\n\n' + s));
2626
}

README.md

Lines changed: 80 additions & 60 deletions
Large diffs are not rendered by default.

SECURITY.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,13 @@ You should receive a response within 24 hours. If for some reason you do not, pl
1616

1717
Please include the requested information listed below (as much as you can provide) to help us better understand the nature and scope of the possible issue:
1818

19-
* Type of issue (e.g. buffer overflow, SQL injection, cross-site scripting, etc.)
20-
* Full paths of source file(s) related to the manifestation of the issue
21-
* The location of the affected source code (tag/branch/commit or direct URL)
22-
* Any special configuration required to reproduce the issue
23-
* Step-by-step instructions to reproduce the issue
24-
* Proof-of-concept or exploit code (if possible)
25-
* Impact of the issue, including how an attacker might exploit the issue
19+
* Type of issue (e.g. buffer overflow, SQL injection, cross-site scripting, etc.)
20+
* Full paths of source file(s) related to the manifestation of the issue
21+
* The location of the affected source code (tag/branch/commit or direct URL)
22+
* Any special configuration required to reproduce the issue
23+
* Step-by-step instructions to reproduce the issue
24+
* Proof-of-concept or exploit code (if possible)
25+
* Impact of the issue, including how an attacker might exploit the issue
2626

2727
This information will help us triage your report more quickly.
2828

0 commit comments

Comments
 (0)