Skip to content

Commit c00c49e

Browse files
committed
revise package.json
1 parent 2d46d7b commit c00c49e

7 files changed

Lines changed: 9 additions & 8 deletions

File tree

1-Authentication/1-sign-in/App/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"ejs": "^3.1.6",
1717
"express": "^4.17.1",
1818
"express-session": "^1.17.1",
19-
"msal-express-wrapper": "file:../../../msal-express-wrapper"
19+
"msal-express-wrapper": "git+https://github.com/Azure-Samples/msal-express-wrapper.git"
2020
},
2121
"devDependencies": {
2222
"nodemon": "^2.0.7"

1-Authentication/1-sign-in/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@ Then, it creates and encodes a state object to pass with an authorization code r
281281
}
282282
```
283283

284-
The `getAuthCode()` method assigns request parameters, and calls the **MSAL Node** [getAuthCodeUrl()](https://azuread.github.io/microsoft-authentication-library-for-js/ref/classes/_azure_msal_node.confidentialclientapplication.html#getauthcodeurl) API. It then redirects the app to this URL:
284+
The `getAuthCode()` method assigns request parameters, and calls the **MSAL Node**'s [getAuthCodeUrl()](https://azuread.github.io/microsoft-authentication-library-for-js/ref/classes/_azure_msal_node.confidentialclientapplication.html#getauthcodeurl) API. It then redirects the app to this URL:
285285

286286
```typescript
287287
/**
@@ -305,7 +305,7 @@ The `getAuthCode()` method assigns request parameters, and calls the **MSAL Node
305305
}
306306
```
307307
308-
After making an authorization code URL request, the user is redirected to the redirect route defined in the **Azure AD** app registration. Once redirected, the `handleRedirect` middleware takes over. It first checks for `nonce` parameter in state against *cross-site resource forgery* (csrf) attacks, and then for the current app stage. Then, using the `code` in query parameters, access tokens are requested using the **MSAL Node** [acquireTokenByCode()](https://azuread.github.io/microsoft-authentication-library-for-js/ref/classes/_azure_msal_node.confidentialclientapplication.html#acquiretokenbycode) API, and the response is appended to the **express-session** variable.
308+
After making an authorization code URL request, the user is redirected to the redirect route defined in the **Azure AD** app registration. Once redirected, the `handleRedirect` middleware takes over. It first checks for `nonce` parameter in state against *cross-site resource forgery* (csrf) attacks, and then for the current app stage. Then, using the `code` in query parameters, access tokens are requested using the **MSAL Node**'s [acquireTokenByCode()](https://azuread.github.io/microsoft-authentication-library-for-js/ref/classes/_azure_msal_node.confidentialclientapplication.html#acquiretokenbycode) API, and the response is appended to the **express-session** variable.
309309
310310
```typescript
311311
/**

1-Authentication/2-sign-in-b2c/App/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"ejs": "^3.0.1",
1818
"express": "^4.17.1",
1919
"express-session": "^1.17.1",
20-
"msal-express-wrapper": "file:../../../msal-express-wrapper"
20+
"msal-express-wrapper": "git+https://github.com/Azure-Samples/msal-express-wrapper.git"
2121
},
2222
"devDependencies": {
2323
"nodemon": "^2.0.2"

2-Authorization/1-call-graph/App/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
"express": "^4.17.1",
2020
"express-session": "^1.17.1",
2121
"isomorphic-fetch": "^3.0.0",
22-
"msal-express-wrapper": "file:../../../msal-express-wrapper"
22+
"msal-express-wrapper": "git+https://github.com/Azure-Samples/msal-express-wrapper.git"
2323
},
2424
"devDependencies": {
2525
"nodemon": "^2.0.2"

3-Deployment/App/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@
2121
"ejs": "^3.0.1",
2222
"express": "^4.17.1",
2323
"express-session": "^1.17.1",
24-
"dotenv": "^8.2.0"
24+
"dotenv": "^8.2.0",
25+
"msal-express-wrapper": "git+https://github.com/Azure-Samples/msal-express-wrapper.git"
2526
},
2627
"devDependencies": {
2728
"nodemon": "^2.0.2"

3-Deployment/App/routes/router.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ const identity = require("@azure/identity");
55
const keyvaultSecret = require('@azure/keyvault-secrets');
66

77
// importing from packages folder
8-
const msalWrapper = require('../packages/msal-express-wrapper/dist');
8+
const msalWrapper = require('msal-express-wrapper');
99

1010
const mainController = require('../controllers/mainController');
1111

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ urlFragment: "ms-identity-javascript-nodejs-tutorial"
2121

2222
The [Microsoft identity platform](https://docs.microsoft.com/azure/active-directory/develop/v2-overview), along with [Azure Active Directory](https://docs.microsoft.com/azure/active-directory/fundamentals/active-directory-whatis) (Azure AD) and [Azure Active Directory B2C](https://docs.microsoft.com/azure/active-directory-b2c/overview) (Azure AD B2C) are central to the **Azure** cloud ecosystem. This tutorial aims to take you through the fundamentals of modern authentication with Node.js, using the [Microsoft Authentication Library for Node.js](https://github.com/AzureAD/microsoft-authentication-library-for-js) (MSAL Node).
2323

24-
This tutorial also features a simple wrapper around **MSAL Node** [ConfidentialClientApplication](https://github.com/AzureAD/microsoft-authentication-library-for-js/blob/dev/lib/msal-node/src/client/ConfidentialClientApplication.ts) class in order to automate routine authentication tasks such as login, logout, token acquisition, as well as utility methods to validate tokens and etc. You can find the wrapper under the [msal-express-wrapper](./msal-express-wrapper/README.md) folder. Feel free to customize it according to your needs. Suggestions and contributions are welcome!
24+
This tutorial also features a simple wrapper around **MSAL Node** [ConfidentialClientApplication](https://github.com/AzureAD/microsoft-authentication-library-for-js/blob/dev/lib/msal-node/src/client/ConfidentialClientApplication.ts) class in order to automate routine authentication tasks such as login, logout, token acquisition, as well as utility methods to validate tokens and etc. You can find the wrapper here: [msal-express-wrapper](https://github.com/Azure-Samples/msal-express-wrapper). Suggestions and contributions are welcome!
2525

2626
We recommend following the chapters in successive order. However, the code samples are self-contained, so feel free to pick samples by topics that you may need at the moment.
2727

0 commit comments

Comments
 (0)