|
3 | 3 | * Licensed under the MIT License. |
4 | 4 | */ |
5 | 5 |
|
6 | | -require('dotenv').config({ path: '.env.dev' }); |
| 6 | +require("dotenv").config({ path: ".env.dev" }); |
7 | 7 |
|
8 | | -const TENANT_SUBDOMAIN = process.env.TENANT_SUBDOMAIN || 'Enter_the_Tenant_Subdomain_Here'; |
9 | | -const REDIRECT_URI = process.env.REDIRECT_URI || 'http://localhost:3000/auth/redirect'; |
10 | | -const POST_LOGOUT_REDIRECT_URI = process.env.POST_LOGOUT_REDIRECT_URI || 'http://localhost:3000'; |
| 8 | +const TENANT_SUBDOMAIN = |
| 9 | + process.env.TENANT_SUBDOMAIN || "Enter_the_Tenant_Subdomain_Here"; |
| 10 | +const REDIRECT_URI = |
| 11 | + process.env.REDIRECT_URI || "http://localhost:3000/auth/redirect"; |
| 12 | +const POST_LOGOUT_REDIRECT_URI = |
| 13 | + process.env.POST_LOGOUT_REDIRECT_URI || "http://localhost:3000"; |
11 | 14 |
|
12 | 15 | /** |
13 | 16 | * Configuration object to be passed to MSAL instance on creation. |
14 | 17 | * For a full list of MSAL Node configuration parameters, visit: |
15 | 18 | * https://github.com/AzureAD/microsoft-authentication-library-for-js/blob/dev/lib/msal-node/docs/configuration.md |
16 | 19 | */ |
17 | 20 | const msalConfig = { |
18 | | - auth: { |
19 | | - clientId: process.env.CLIENT_ID || 'Enter_the_Application_Id_Here', // 'Application (client) ID' of app registration in Azure portal - this value is a GUID |
20 | | - authority: process.env.AUTHORITY || `https://${TENANT_SUBDOMAIN}.ciamlogin.com/`, // Replace the placeholder with your tenant name |
21 | | - clientSecret: process.env.CLIENT_SECRET || 'Enter_the_Client_Secret_Here', // Client secret generated from the app registration in Azure portal |
22 | | - }, |
23 | | - system: { |
24 | | - loggerOptions: { |
25 | | - loggerCallback(loglevel, message, containsPii) { |
26 | | - console.log(message); |
27 | | - }, |
28 | | - piiLoggingEnabled: false, |
29 | | - logLevel: 'Info', |
30 | | - }, |
| 21 | + auth: { |
| 22 | + clientId: process.env.CLIENT_ID || "Enter_the_Application_Id_Here", // 'Application (client) ID' of app registration in Azure portal - this value is a GUID |
| 23 | + authority: |
| 24 | + process.env.AUTHORITY || `https://${TENANT_SUBDOMAIN}.ciamlogin.com/`, // Replace the placeholder with your tenant name |
| 25 | + clientSecret: process.env.CLIENT_SECRET || "Enter_the_Client_Secret_Here", // Client secret generated from the app registration in Azure portal |
| 26 | + }, |
| 27 | + system: { |
| 28 | + loggerOptions: { |
| 29 | + loggerCallback(loglevel, message, containsPii) { |
| 30 | + console.log(message); |
| 31 | + }, |
| 32 | + piiLoggingEnabled: false, |
| 33 | + logLevel: "Info", |
31 | 34 | }, |
| 35 | + }, |
32 | 36 | }; |
33 | 37 |
|
34 | 38 | const GRAPH_API_ENDPOINT = process.env.GRAPH_API_ENDPOINT || "graph_end_point"; |
35 | 39 | // Refers to the user that is single user singed in. |
36 | 40 | // https://learn.microsoft.com/en-us/graph/api/user-update?view=graph-rest-1.0&tabs=http |
37 | 41 | const GRAPH_ME_ENDPOINT = GRAPH_API_ENDPOINT + "v1.0/me"; |
38 | 42 |
|
39 | | -const mfaProtectedResourceScope = process.env.MFA_PROTECTED_SCOPE || 'Add_your_protected_scope_here'; |
| 43 | +const editProfileScope = |
| 44 | + process.env.EDIT_PROFILE_SCOPE || "Add_your_protected_scope_here"; |
40 | 45 |
|
41 | 46 | module.exports = { |
42 | | - msalConfig, |
43 | | - mfaProtectedResourceScope, |
44 | | - REDIRECT_URI, |
45 | | - POST_LOGOUT_REDIRECT_URI, |
46 | | - TENANT_SUBDOMAIN, |
47 | | - GRAPH_API_ENDPOINT, |
48 | | - GRAPH_ME_ENDPOINT, |
| 47 | + msalConfig, |
| 48 | + editProfileScope, |
| 49 | + REDIRECT_URI, |
| 50 | + POST_LOGOUT_REDIRECT_URI, |
| 51 | + TENANT_SUBDOMAIN, |
| 52 | + GRAPH_API_ENDPOINT, |
| 53 | + GRAPH_ME_ENDPOINT, |
49 | 54 | }; |
0 commit comments