How to use the msal.LogLevel function in msal

To help you get started, we’ve selected a few msal examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github AzureAD / microsoft-authentication-library-for-js / samples / MsalAngularjsDemoApp / app.js View on Github external
window.applicationConfig = {
    clientID: '883bb2bc-6548-4906-b842-17014a0601a1',
    consentScopes: ["user.read"],
    webApiEndpoint: "https://buildtodoservice.azurewebsites.net/api/todolist",
    webApiScopes: ['api://a88bb933-319c-41b5-9f04-eff36d985612/access_as_user'],
    userProfileEndpoint: "https://graph.microsoft.com/v1.0/me",
    userProfileScopes: ["user.read"],
};

var protectedResourceMap = new Map();
protectedResourceMap.set(applicationConfig.webApiEndpoint, applicationConfig.webApiScopes);
protectedResourceMap.set(applicationConfig.userProfileEndpoint, applicationConfig.userProfileScopes);


var logger = new Msal.Logger(loggerCallback, {level: Msal.LogLevel.Verbose, correlationId: '12345'});

function loggerCallback(logLevel, message, piiEnabled) {
    console.log(message);
}

if (window !== window.parent && !window.opener) {
    angular.module('todoApp', ['ui.router', 'MsalAngular'])
        .config(['$httpProvider', 'msalAuthenticationServiceProvider','$locationProvider', function ($httpProvider, msalProvider,$locationProvider) {
            msalProvider.init({
                clientID: applicationConfig.clientID,
                authority: 'https://login.microsoftonline.com/common',
                tokenReceivedCallback: function (errorDesc, token, error, tokenType) {
                },
                optionalParams: {
                    cacheLocation: 'localStorage',
                    logger: logger,