Skip to content

Commit c38220b

Browse files
authored
Merge pull request #94 from BenBagBag/ch-1-node-cli-signin-screen
Ch 1 node cli signin screen
2 parents d8a3ebb + 24527bd commit c38220b

5 files changed

Lines changed: 334 additions & 18 deletions

File tree

1-Authentication/6-sign-in-node-cli-app/App/authConfig.js

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
const { LogLevel } = require('@azure/msal-node');
1+
import { LogLevel } from '@azure/msal-node';
22

33
/**
44
* Configuration object to be passed to MSAL instance on creation.
55
* For a full list of MSAL.js configuration parameters, visit:
66
* https://github.com/AzureAD/microsoft-authentication-library-for-js/blob/dev/lib/msal-node/docs/configuration.md
77
*/
8-
const msalConfig = {
8+
export const msalConfig = {
99
auth: {
1010
clientId: 'Enter_the_Application_Id_Here',
11-
authority: 'https://Enter_the_Tenant_Subdomain_Here.ciamlogin.com/',
11+
authority: 'https://Enter_the_Tenant_Subdomain_Here.ciamlogin.com/',
1212
},
1313
system: {
1414
loggerOptions: {
@@ -27,11 +27,6 @@ const msalConfig = {
2727
* For more information about OIDC scopes, visit:
2828
* https://docs.microsoft.com/en-us/azure/active-directory/develop/v2-permissions-and-consent#openid-connect-scopes
2929
*/
30-
const loginRequest = {
30+
export const loginRequest = {
3131
scopes: [],
32-
};
33-
34-
module.exports = {
35-
msalConfig: msalConfig,
36-
loginRequest: loginRequest,
37-
};
32+
};

1-Authentication/6-sign-in-node-cli-app/App/index.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
* Copyright (c) Microsoft Corporation. All rights reserved.
33
* Licensed under the MIT License.
44
*/
5-
const { PublicClientApplication, InteractionRequiredAuthError } = require('@azure/msal-node');
6-
const open = require('open');
7-
const { msalConfig, loginRequest } = require('./authConfig');
5+
import { PublicClientApplication, InteractionRequiredAuthError } from '@azure/msal-node';
6+
import open from 'open';
7+
import { msalConfig, loginRequest } from './authConfig.js';
88

99
// Before running the sample, you will need to replace the values in src/authConfig.js
1010

1-Authentication/6-sign-in-node-cli-app/App/package-lock.json

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

1-Authentication/6-sign-in-node-cli-app/App/package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,15 @@
33
"version": "1.0.0",
44
"description": "CLI sample for msal-node public client application using using auth code flow with PKCE to sign-in users on azure ad CIAM",
55
"main": "index.js",
6+
"type":"module",
67
"scripts": {
78
"test": "echo \"Error: no test specified\" && exit 1",
89
"start": "node index.js"
910
},
1011
"author": "",
1112
"license": "ISC",
1213
"dependencies": {
13-
"@azure/msal-node": "^1.17.1",
14-
"open": "^8.4.0"
14+
"@azure/msal-node": "^2.9.2",
15+
"open": "^10.1.0"
1516
}
1617
}

0 commit comments

Comments
 (0)