@equinor/fusion-framework-module-msal-node
Version:
Fusion Framework module for secure Azure AD authentication in Node.js using MSAL. Supports interactive, silent, and token-only authentication modes with encrypted token storage.
26 lines • 1.02 kB
JavaScript
import { AuthConfigurator } from './AuthConfigurator.js';
import { AuthProvider } from './AuthProvider.js';
import { AuthTokenProvider } from './AuthTokenProvider.js';
import { AuthProviderInteractive } from './AuthProviderInteractive.js';
export const module = {
name: 'auth',
configure: () => new AuthConfigurator(),
initialize: async (args) => {
const config = await args.config.createConfigAsync(args);
switch (config.mode) {
case 'token_only':
return new AuthTokenProvider(config.accessToken);
case 'interactive': {
const { client, server } = config;
if (!server) {
throw new Error('Server configuration is required for interactive mode');
}
return new AuthProviderInteractive(client, { server });
}
default:
return new AuthProvider(config.client);
}
},
};
export default module;
//# sourceMappingURL=module.js.map