Add minimal add-in playgrounds and orchestrator
This commit is contained in:
@@ -0,0 +1,51 @@
|
||||
/**
|
||||
* MSAL Configuration for delegated user authentication
|
||||
* Used by Office Add-in to acquire user tokens with automatic refresh
|
||||
*/
|
||||
|
||||
export const msalConfig = {
|
||||
auth: {
|
||||
clientId: '3c846e71-9609-40e1-b458-0eb805e21b9f', // Replace with your app ID
|
||||
authority: 'https://login.microsoftonline.com/common', // Multi-tenant
|
||||
redirectUri: 'https://localhost:3000/createFolder.html', // Must match manifest
|
||||
},
|
||||
cache: {
|
||||
cacheLocation: 'localStorage', // Persists tokens across sessions
|
||||
storeAuthStateInCookie: false,
|
||||
},
|
||||
system: {
|
||||
loggerOptions: {
|
||||
loggerCallback: (level, message, containsPii) => {
|
||||
if (!containsPii) {
|
||||
try {
|
||||
// Forward MSAL logs to the add-in UI logger if available
|
||||
if (typeof window !== 'undefined' && window.__addinLog) {
|
||||
window.__addinLog(`[MSAL] ${message}`);
|
||||
} else {
|
||||
console.log(`[MSAL] ${message}`);
|
||||
}
|
||||
} catch (e) {
|
||||
console.log(`[MSAL] ${message}`);
|
||||
}
|
||||
}
|
||||
},
|
||||
piiLoggingEnabled: false,
|
||||
logLevel: 'Verbose',
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
/**
|
||||
* Scopes required for the add-in
|
||||
* Files.ReadWrite.All: Create/read/write files in SharePoint
|
||||
*/
|
||||
export const loginRequest = {
|
||||
scopes: ['https://graph.microsoft.com/Files.ReadWrite.All'],
|
||||
};
|
||||
|
||||
/**
|
||||
* Scopes for acquiring token for API calls (backend)
|
||||
*/
|
||||
export const tokenRequest = {
|
||||
scopes: ['https://graph.microsoft.com/Files.ReadWrite.All'],
|
||||
};
|
||||
Reference in New Issue
Block a user