51 lines
1.6 KiB
JavaScript
51 lines
1.6 KiB
JavaScript
/*
|
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
* Licensed under the MIT License.
|
|
*/
|
|
|
|
const { LogLevel } = require("@azure/msal-node");
|
|
|
|
/**
|
|
* Configuration object to be passed to MSAL instance on creation.
|
|
* For a full list of MSAL.js configuration parameters, visit:
|
|
* https://github.com/AzureAD/microsoft-authentication-library-for-js/blob/dev/lib/msal-node/docs/configuration.md
|
|
*/
|
|
const AAD_ENDPOINT_HOST = "https://login.microsoftonline.com/"; // include the trailing slash
|
|
|
|
const msalConfig = {
|
|
auth: {
|
|
clientId: "d581ab07-3a21-44d3-84c4-16b06bef6266",
|
|
authority: "https://login.microsoftonline.com/consumers",
|
|
redirectUri: "msal" + "d581ab07-3a21-44d3-84c4-16b06bef6266" + "://auth"
|
|
},
|
|
system: {
|
|
loggerOptions: {
|
|
loggerCallback: (loglevel, message) => console.log(message),
|
|
piiLoggingEnabled: false,
|
|
logLevel: LogLevel.Verbose
|
|
}
|
|
}
|
|
};
|
|
|
|
/**
|
|
* Add here the endpoints and scopes when obtaining an access token for protected web APIs. For more information, see:
|
|
* https://github.com/AzureAD/microsoft-authentication-library-for-js/blob/dev/lib/msal-browser/docs/resources-and-scopes.md
|
|
*/
|
|
const GRAPH_ENDPOINT_HOST = "https://graph.microsoft.com/"; // include the trailing slash
|
|
|
|
const protectedResources = {
|
|
graphMe: {
|
|
endpoint: `${GRAPH_ENDPOINT_HOST}v1.0/me`,
|
|
// scopes: ["User.Read"],
|
|
scopes: ["Files.ReadWrite"]
|
|
}
|
|
};
|
|
|
|
const graphScopes = ["Files.ReadWrite"]; // Modern scope for OneDrive access
|
|
|
|
module.exports = {
|
|
msalConfig,
|
|
protectedResources: protectedResources,
|
|
graphScopes: graphScopes
|
|
};
|