Git Product home page Git Product logo

msgraph-sample-javascriptspa's Introduction

page_type description products languages
sample
This sample demonstrates how to use the Microsoft Graph JavaScript SDK to access data in Office 365 from JavaScript browser apps.
ms-graph
office-exchange-online
javascript

Microsoft Graph sample JavaScript single-page app

This sample demonstrates how to use the Microsoft Graph JavaScript SDK to access data in Office 365 from JavaScript browser apps.

Prerequisites

Before you start this tutorial, you will need access to an HTTP server to host the sample files. This could be a test server on your development machine, or a remote server.

You should also have either a personal Microsoft account with a mailbox on Outlook.com, or a Microsoft work or school account. If you don't have a Microsoft account, there are a couple of options to get a free account:

Register the app

Create a new Azure AD web application registration using the Azure Active Directory admin center.

  1. Open a browser and navigate to the Azure Active Directory admin center. Login using a personal account (aka: Microsoft Account) or Work or School Account.

  2. Select Azure Active Directory in the left-hand navigation, then select App registrations under Manage.

    [!NOTE] Azure AD B2C users may only see App registrations (legacy). In this case, please go directly to https://aka.ms/appregistrations.

  3. Select New registration. On the Register an application page, set the values as follows.

    • Set Name to JavaScript Graph Tutorial.
    • Set Supported account types to Accounts in any organizational directory and personal Microsoft accounts.
    • Under Redirect URI, set the first drop-down to Single-page application (SPA) and set the value to http://localhost:8080.
  4. Choose Register. On the JavaScript Graph Tutorial page, copy the value of the Application (client) ID and save it, you will need it in the next step.

Configure the sample

  1. Rename the ./graph-tutorial/src/Config.example.js file to ./graph-tutorial/src/Config.js.
  2. Edit the ./graph-tutorial/src/Config.js file and make the following changes.
  3. Replace YOUR_APP_ID_HERE with the Application Id you got from the App Registration Portal.

Note

The steps in this section require Node.js.

Running the sample

Host the files in the graph-tutorial directory on your HTTP server. If you don't have access to a server, here are a couple of options for test server tools to run on your development machine.

http-server

If you have Node.js, http-server is a simple command-line HTTP server.

  1. Open your command-line interface (CLI) in the graph-tutorial directory.

  2. Run the following command to start a web server in that directory.

    npx http-server -c-1 -p 8080
  3. Open your browser and browse to http://localhost:8080.

dotnet-serve

If you have the .NET SDK installed, [dotnet-serve] is a simple command-line HTTP server.

  1. Open your command-line interface (CLI) in the graph-tutorial directory.

  2. Run the following command to start a web server in that directory.

    dotnet serve -p 8080
  3. Open your browser and browse to http://localhost:8080.

Code of conduct

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact [email protected] with any additional questions or comments.

Disclaimer

THIS CODE IS PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.

msgraph-sample-javascriptspa's People

Contributors

baywet avatar dodaromike avatar freerangeeggs avatar jasonjoh avatar marcusbirkin avatar microsoft-github-policy-service[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

msgraph-sample-javascriptspa's Issues

Does this repo still have functioning code?

Hello,

I was using the code within this repo as a base for an app a couple of years ago.

I ran into a bug that I couldn't resolve (caused by new conventions and authorisation methods being required since the tutorial first came out) and then got busy with other things and haven't looked at it since then.

I revisited this repo today and saw this message in the README:

NOTE: This sample was originally built from a tutorial published on the Microsoft Graph tutorials page. That tutorial has been removed.

Does that mean we should not use the code in the repo as a base anymore?

Because it has been superseded by new conventions and authorisation methods etc?

And, if so, is the most up to date approach to creating a Single Page App (JavaScript) to be found in this tutorial:

https://docs.microsoft.com/en-us/azure/active-directory/develop/tutorial-v2-javascript-auth-code

Thank You.

Feedback: fewer tutorials and more 'bare bones' content might help new users get up and running more quickly?

Firstly, sorry for the long post :)

Short Version

As a newbie to Microsoft Graph and the Microsoft cloud ecosystem I think there are too many tutorials about the same subject that have slight differences in their code snippets. This makes it difficult to ascertain which are the most authoritative.

Alongside, and possibly due to, this dynamic, I found it quite time consuming to 'pull apart' the tutorial code (https://docs.microsoft.com/en-us/graph/tutorials/javascript) quickly so that I could create my own interface and start playing around with the API.

I've included my own 'bare bones' version of the tutorial code in a post below in case it helps anyone else understand the tutorial components more quickly.

Caveats: I am a newbie and official code should be more trusted than my version of it. Also, to avoid any misunderstandings, I do appreciate the effort that went into the original tutorial code. Only tested in Chrome.

Long Version

Hello,

I came across Microsoft Graph about a week ago and was very keen to start playing around with the API, mainly with SharePoint and Lists, Groups, Teams and Planner.

Just documenting my experiences below as someone new to Microsoft Graph (and the MS cloud ecosystem in general).

I completed the tutorial below fairly painlessly and had a localhost app up and running quickly:

https://docs.microsoft.com/en-us/graph/tutorials/javascript

When it came to trying to 'deconstruct' the components though, I got a bit overwhelmed and it has taken me about a week to get a fairly decent grasp of what is needed to create a 'single page app' and start making my own requests.

I've included my own 'bare bones' version of the tutorial code in a post below in case it helps anyone else understand the tutorial components more quickly (it's jQuery and Python'ish in style because they make things simpler for me:)).

I have several questions about it's content though (from a general logic perspective, not a specific programming perspective), such as:

  • is the cache property in msalConfig necessary? it is not shown in other tutorials.
  • why are MSAL authentication and scope definition required in the graph.js part of the application if the user has already signed in with msalApplication.loginPopup(scopes)?
  • why do scopes need to be defined in the app if they are defined in the Azure Active Directory App Registrations area?
  • seeing as this is all browser side code, does clientId in config.js need to be hidden somehow? or is that not necessary because the user has to login in order to make api requests?

In regards to the reasons I got overwhelmed, in the spirit of hopefully constructive feedback, I think it was because :

  1. there are many tutorials written about the same thing with slightly different config/authentication code snippets - it is hard to know which example is the most authoritative/correct , which is relevant to my scenario, and the purpose and relevance of several object properties in MSAL and Graph configurations.

I have come across this dynamic in other software companies, where lots of people are writing about the same thing. Some people think it is good because people have different learning styles. But you end up with 'developer docs', 'official docs', 'marketing docs', 'blog docs' and 'user docs' where the content overlaps, but with slight discrepancies, and the end-user is left unsure what is the most authoritative content.

  1. for me, there was too much ui.js code in the tutorial that I had to go through to see how it related to the configuration/authentication/request logic (after spending more time with it, I can see the logic is pretty separate, but I wasn't sure at first - the updatePage() function and Views variable threw me). anyway, that was the impetus behind creating a 'bare bones' version.

In regards to the first reason, here are some examples:

code snippets from these links are shown below for comparison:

A) https://docs.microsoft.com/en-us/graph/tutorials/javascript?tutorial-step=3

B) https://github.com/microsoftgraph/msgraph-sdk-javascript

C) https://github.com/AzureAD/microsoft-authentication-library-for-js/tree/dev/lib/msal-core

D) https://docs.microsoft.com/en-gb/azure/active-directory/develop/msal-js-initializing-client-applications

E) https://docs.microsoft.com/en-us/azure/active-directory/develop/scenario-spa-sign-in?tabs=javascript

these links also have similar content:

https://docs.microsoft.com/en-us/azure/active-directory/develop/tutorial-v2-javascript-spa

https://docs.microsoft.com/en-us/azure/active-directory/develop/quickstart-v2-javascript

https://github.com/Azure-Samples/active-directory-javascript-graphapi-v2

https://github.com/AzureAD/microsoft-authentication-library-for-js/wiki

https://docs.microsoft.com/en-us/graph/auth-register-app-v2

A) https://docs.microsoft.com/en-us/graph/tutorials/javascript?tutorial-step=3

// config.js  

const msalConfig = {
  auth: {
    clientId: 'YOUR_APP_ID_HERE',
    redirectUri: 'http://localhost:8080'
  },
  cache: {
    cacheLocation: "sessionStorage",
    storeAuthStateInCookie: false,
    forceRefresh: false
  }
};

const loginRequest = {
  scopes: [
    'openid',
    'profile',
    'user.read',
    'calendars.read'
  ]
}


// auth.js 

// Create the main MSAL instance
// configuration parameters are located in config.js
const msalClient = new Msal.UserAgentApplication(msalConfig);

if (msalClient.getAccount() && !msalClient.isCallback(window.location.hash)) {
  // avoid duplicate code execution on page load in case of iframe and Popup window.
  updatePage(msalClient.getAccount(), Views.home);
}

async function signIn() {
  // Login
  try {
    await msalClient.loginPopup(loginRequest);
    console.log('id_token acquired at: ' + new Date().toString());
    if (msalClient.getAccount()) {
      updatePage(msalClient.getAccount(), Views.home);
    }
  } catch (error) {
    console.log(error);
    updatePage(null, Views.error, {
      message: 'Error logging in',
      debug: error
    });
  }
}

function signOut() {
  msalClient.logout();
}


// graph.js 

// Create an options object with the same scopes from the login
const options =
  new MicrosoftGraph.MSALAuthenticationProviderOptions([
    'user.read',
    'calendars.read'
  ]);
// Create an authentication provider for the implicit flow
const authProvider =
  new MicrosoftGraph.ImplicitMSALAuthenticationProvider(msalClient, options);
// Initialize the Graph client
const graphClient = MicrosoftGraph.Client.initWithMiddleware({authProvider});

B) https://github.com/microsoftgraph/msgraph-sdk-javascript

// Configuration options for MSAL @see https://github.com/AzureAD/microsoft-authentication-library-for-js/wiki/MSAL.js-1.0.0-api-release#configuration-options
const msalConfig = {
	auth: {
		clientId: "your_client_id", // Client Id of the registered application
		redirectUri: "your_redirect_uri",
	},
};
const graphScopes = ["user.read", "mail.send"]; // An array of graph scopes

// Important Note: This library implements loginPopup and acquireTokenPopup flow, remember this while initializing the msal
// Initialize the MSAL @see https://github.com/AzureAD/microsoft-authentication-library-for-js#1-instantiate-the-useragentapplication
const msalApplication = new Msal.UserAgentApplication(msalConfig);
const options = new MicrosoftGraph.MSALAuthenticationProviderOptions(graphScopes);
const authProvider = new MicrosoftGraph.ImplicitMSALAuthenticationProvider(msalApplication, options);

const options = {
	authProvider, // An instance created from previous step
};
const Client = MicrosoftGraph.Client;
const client = Client.initWithMiddleware(options);

C) https://github.com/AzureAD/microsoft-authentication-library-for-js/tree/dev/lib/msal-core

import * as Msal from "msal";
// if using cdn version, 'Msal' will be available in the global scope

const msalConfig = {
    auth: {
        clientId: 'your_client_id'
    }
};

const msalInstance = new Msal.UserAgentApplication(msalConfig);

msalInstance.handleRedirectCallback((error, response) => {
    // handle redirect response or error
});

var loginRequest = {
    scopes: ["user.read", "mail.send"] // optional Array<string>
};

msalInstance.loginPopup(loginRequest)
    .then(response => {
        // handle response
    })
    .catch(err => {
        // handle error
    });

// if the user is already logged in you can acquire a token
if (msalInstance.getAccount()) {
    var tokenRequest = {
        scopes: ["user.read", "mail.send"]
    };
    msalInstance.acquireTokenSilent(tokenRequest)
        .then(response => {
            // get access token from response
            // response.accessToken
        })
        .catch(err => {
            // could also check if err instance of InteractionRequiredAuthError if you can import the class.
            if (err.name === "InteractionRequiredAuthError") {
                return msalInstance.acquireTokenPopup(tokenRequest)
                    .then(response => {
                        // get access token from response
                        // response.accessToken
                    })
                    .catch(err => {
                        // handle error
                    });
            }
        });
} else {
    // user is not logged in, you will need to log them in to acquire a token
}

var headers = new Headers();
var bearer = "Bearer " + token;
headers.append("Authorization", bearer);
var options = {
    method: "GET",
    headers: headers
};
var graphEndpoint = "https://graph.microsoft.com/v1.0/me";

fetch(graphEndpoint, options)
    .then(resp => {
        //do something with response
    });

D) https://docs.microsoft.com/en-gb/azure/active-directory/develop/msal-js-initializing-client-applications

// Configuration object constructed
const config = {
    auth: {
        clientId: "abcd-ef12-gh34-ikkl-ashdjhlhsdg"
    }
}

// create UserAgentApplication instance
const myMSALObj = new UserAgentApplication(config);

function authCallback(error, response) {
    //handle redirect response
}

// (optional when using redirect methods) register redirect call back for Success or Error
myMSALObj.handleRedirectCallback(authCallback);

type storage = "localStorage" | "sessionStorage";

// Protocol Support
export type AuthOptions = {
    clientId: string;
    authority?: string;
    validateAuthority?: boolean;
    redirectUri?: string | (() => string);
    postLogoutRedirectUri?: string | (() => string);
    navigateToLoginRequestUrl?: boolean;
};

// Cache Support
export type CacheOptions = {
    cacheLocation?: CacheLocation;
    storeAuthStateInCookie?: boolean;
};

// Library support
export type SystemOptions = {
    logger?: Logger;
    loadFrameTimeout?: number;
    tokenRenewalOffsetSeconds?: number;
    navigateFrameWait?: number;
};

// Developer App Environment Support
export type FrameworkOptions = {
    isAngular?: boolean;
    unprotectedResources?: Array<string>;
    protectedResourceMap?: Map<string, Array<string>>;
};

// Configuration Object
export type Configuration = {
    auth: AuthOptions,
    cache?: CacheOptions,
    system?: SystemOptions,
    framework?: FrameworkOptions
};

E) https://docs.microsoft.com/en-us/azure/active-directory/develop/scenario-spa-sign-in?tabs=javascript

const loginRequest = {
    scopes: ["https://graph.microsoft.com/User.ReadWrite"]
}

userAgentApplication.loginPopup(loginRequest).then(function (loginResponse) {
    //login success
    let idToken = loginResponse.idToken;
}).catch(function (error) {
    //login failure
    console.log(error);
});

function authCallback(error, response) {
    //handle redirect response
}

userAgentApplication.handleRedirectCallback(authCallback);

const loginRequest = {
    scopes: ["https://graph.microsoft.com/User.ReadWrite"]
}

userAgentApplication.loginRedirect(loginRequest);

const config = {
    auth: {
        clientId: 'your_app_id',
        redirectUri: "your_app_redirect_uri", //defaults to application start page
        postLogoutRedirectUri: "your_app_logout_redirect_uri"
    }
}

const userAgentApplication = new UserAgentApplication(config);
userAgentApplication.logout();

End of post.

Feedback: Document 'Permissions requested' popup during sign in

After reading the the Implement sign-in section on:

https://docs.microsoft.com/en-us/graph/tutorials/javascript?tutorial-step=3

I clicked 'Sign in' and there was a popup window with several permissions requested.

This threw me off a bit because it was not documented on the tutorial page.

So i think it would be good if it was documented on that page, with a description of what each permission meant and which options should be selected (in the popup window).

Additionally, I remembered I had seen a section in a video tutorial about granting 'Admin consent' in the API Permissions section of the App Registrations area that removed the need for users to have to provide consent:

Video: https://youtu.be/93j0MmRruFo?t=230
Relevant Section: 3:50
Video Title: Getting Started with Microsoft Graph and Application Registration
Embedded on: https://docs.microsoft.com/en-us/graph/auth-register-app-v2

So I did that step, refreshed the page and clicked 'Sign In' and still got the 'Permissions requested' popup.

Is that expected behaviour?

Thank You.

Issue regarding ImplicitMSALAuthenticationProvider

I have imported the ImplicitMSALAuthenticationProvider from the required module but again it is showing error.
Attempted import error: 'MSALAuthenticationProviderOptions' is not exported from '@microsoft/microsoft-graph-client' (imported as 'MicrosoftGraph').
Can anyone check this

Feedback: Explain why bluebird library is included in tutorial

I am trying to understand what is essential in getting an app that queries Microsoft Graph up and running. I am following the tutorial here:

https://docs.microsoft.com/en-us/graph/tutorials/javascript?tutorial-step=1

In the HTML section it shows this:

 <!-- MSAL -->
 <script src="https://cdn.jsdelivr.net/npm/[email protected]/js/browser/bluebird.min.js"></script>
 <script src="https://alcdn.msftauth.net/lib/1.2.1/js/msal.js"
         integrity="sha384-9TV1245fz+BaI+VvCjMYL0YDMElLBwNS84v3mY57pXNOt6xcUYch2QLImaTahcOP"
         crossorigin="anonymous"></script>

 <!-- Graph SDK -->
 <script src="https://cdn.jsdelivr.net/npm/@microsoft/microsoft-graph-client/lib/graph-js-sdk.js"></script>

It goes on to say:

This defines the basic layout of the app, including a navigation bar. It also adds the following:

Bootstrap and its supporting JavaScript
FontAwesome
Moment.js
Microsoft Authentication Library for JavaScript (MSAL.js)
Microsoft Graph JavaScript Client Library

but doesn't mention Bluebird.

Why is bluebird included beneath the MSAL comment, and is Bluebird required for the app to function?

Related research:

What is Bluebird?
A promise library for JavaScript.

Are promises supported in browsers?
https://caniuse.com/#feat=promises

Tutorial code for ui.js has a bug when referencing the account variable - it should be user

Where did you get the code?

Describe the bug

The code in the tutorial (to copy/paste) when creating the ui.js file has a bug. This if statement should be if (user) not if (account)
JS-SPA-02-if-user

To Reproduce

Follow the tutorial and copy/paste the code when creating ui.js

Expected behavior

I expect the sign in to work and to see my account details, instead I get no welcome message and an error regarding no account in the javascript console.

The completed demo in this GitHub repo has the correct code, it's just the tutorial that is wrong.

Understanding the difference between 'single', 'multitenant' and 'multitenant and personal ms accounts' options

Re: https://docs.microsoft.com/en-us/graph/tutorials/javascript?tutorial-step=2

These are the options available:

Supported account types
Who can use this application or access this API?

Accounts in this organizational directory only ([my organisation name] - Single tenant)
Accounts in any organizational directory (Any Azure AD directory - Multitenant)
Accounts in any organizational directory (Any Azure AD directory - Multitenant) and personal Microsoft accounts (e.g. Skype, Xbox)

The tutorial instructs to choose the last option and "locate the Implicit grant section and enable Access tokens and ID tokens".

There is a link below the options area that says 'help me choose' which provides this information:

Understanding different account types

Accounts in this organizational directory only ([my organisation name] only - Single tenant)
All user and guest accounts in your directory can use your application or API.

Use this option if your target audience is internal to your organization.

Accounts in any organizational directory (Any Azure AD directory - Multitenant)
All users with a work or school account from Microsoft can use your application or API. This includes schools and businesses that use Office 365.

Use this option if your target audience is business or educational customers and to enable multitenancy.

Personal Microsoft accounts only
Personal accounts that are used to sign in to services like Xbox and Skype.

Use this option to target the widest set of Microsoft identities.

Due to temporary differences in functionality, you may see errors if you attempt to switch between supported audiences after registering the application.

The way I interpret 'single tenant' therefore is:

Any user in my organisation account can login and use the app, everyone else can't.

When I register an app and select the 'single tenant' option and try and login (with the only user account in the organisation account), I get this error:

ServerError: AADSTS50194: Application 'application-id-here'(app-name-here) is not configured as a multi-tenant application. Usage of the /common endpoint is not supported for such applications created after '10/15/2018'. Use a tenant-specific endpoint or configure the application to be multi-tenant.

So the desired behaviour is that only users within the organisation can access the app

Why isn't it working and how can I get it working?

Thank You.

Edit - related research:

MicrosoftDocs/azure-docs#19646

MicrosoftDocs/azure-docs#19346

https://docs.microsoft.com/en-us/azure/active-directory/develop/supported-accounts-validation

https://docs.microsoft.com/en-us/azure/active-directory/develop/howto-convert-app-to-be-multi-tenant#update-registration-to-be-multi-tenant

Search results for /common in MSAL repo:

https://github.com/AzureAD/microsoft-authentication-library-for-js/search?q=%2Fcommon&unscoped_q=%2Fcommon

Tutorial's mistakes

Where did you get the code?

Describe the bug

In Russian tutorial step 1 two mistakes in file name:

  1. Создайте новый файл сauth.js и добавьте следующий код.
  1. Создайте новый файл сui.js и добавьте следующий код.

extra C at the beginning of the filename

Next:

On registration app step need next step with add permissions for Calendars.ReadWrite and MailboxSettings.Read
because by default after registration we have only User.Read permission in new app

in config.js

const msalRequest = {
  scopes: [
    'user.read', // set by default
    'mailboxsettings.read', // not set by default and app crashed with error
    'calendars.readwrite' // not set by default and app crashed with error
  ]
}

sorry for this, not complete, typing errors

Error getting events, empty JS object on page content

Where did you get the code?

Describe the bug

Alert text: "Error getting events." along with an empty JS object {}

No console errors are logged.

All the code is downloaded directly from this repo. I am signed into an Outlook account with several calendar events already added.

To Reproduce

Steps to reproduce the behavior:

  1. Click on "calendar" in nav bar

Expected behavior

The table should display calendar events

Desktop

  • OS: Windows 7
  • Browser: Chrome, Firefox
  • Version: latest for both

Calling graph API without graphClient

I am following the below link to call the Graph API in my angularjs application:
https://docs.microsoft.com/en-us/graph/tutorials/javascript
In code msalClient is declared as:
const msalClient = new Msal.UserAgentApplication(msalConfig);
With the help of msalClient we show the login pop up and user gets authenticated.

Now As per the tutorial, if we want to call the graph API , we can use graphClient as below:
const graphClient = MicrosoftGraph.Client.initWithMiddleware({ authProvider });
graphClient.api('/me/events')

I do not want to use graphClient. I want to make Http Request in angularjs service. For this I need to pass authrizaton code to API.

How can I get authorization code

Not showing Signed in page

Hi,

I would like to have kind advise regarding the error which I`m facing.

According to the tutorial for SPA javascript program with MS graph,
I have completed by step 04-add-auth (implement sign-in) and when I tried to
login to MS account from sign-in on javascript app, UI didn`t change to indicate that I could signed-in.

In more detail about my error,

  1. When I click "sign in", the pop-up window for MS login shown
  2. Signed-in to MS with my account and password
  3. Redirect to my localhost and new pop-up window shown
  4. UI not change to indicate that I am signed-in (Not shown with message of welcome and account info like screen on tutorial)

I`m not sure what is the cause of this error and have no clue.
Appreciate for your help if you could.

'user' variable not declared before being assigned value

See this page:

https://docs.microsoft.com/en-us/graph/tutorials/javascript?tutorial-step=3

At step:

  1. Replace the existing signIn function with the following.

I think this code:

// Get the user's profile from Graph
user = await getUser();

Should be:

// Get the user's profile from Graph
var user = await getUser();

As I don't think the variable user has been declared beforehand.

For me, omitting the var seemed to result in the pop up window not closing after sign in, and graphClient remaining undefined which meant I couldn't make calls to the graph api.

error when running local server: crbug/1173575, non-JS module files deprecated.

Where did you get the code?

See:

https://docs.microsoft.com/en-us/graph/tutorials/javascript?tutorial-step=1

At the step:

"Start a local web server (optional)"

Describe the bug

After I run the following command in cmd prompt:

npx http-server -c-1

I get these results:

npx: installed 34 in 5.571s
Starting up http-server, serving ./

http-server version: 14.0.0

http-server settings:
CORS: disabled
Cache: -1 seconds
Connection Timeout: 120 seconds
Directory Listings: visible
AutoIndex: visible
Serve GZIP Files: false
Serve Brotli Files: false
Default File Extension: none

Available on:
  http://192.168.1.102:8080
  http://127.0.0.1:8080
Hit CTRL-C to stop the server

When I try to access either of those URL's in Chrome browser I get the error:

(index):7288 crbug/1173575, non-JS module files deprecated.  

Desktop

  • Windows 10
  • Chrome Version 95.0.4638.54 (Official Build) (64-bit)

Dependency versions

MSAL:

<script type="text/javascript" src="https://alcdn.msauth.net/lib/1.3.0/js/msal.js" integrity="sha384-xeOjp8/l8VazdeNFRbrC9LWPR1InyrS8E1Na/0lv6V2r09iwX6vJC47FXlczokMi" crossorigin="anonymous"></script>

JavaScript SDK:

<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/@microsoft/microsoft-graph-client/lib/graph-js-sdk.js"></script>

Node Version:
v10.16.3

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.