Skip to content

Samples

Doğan Erişen edited this page May 25, 2020 · 28 revisions

Dev Samples

These samples showcase the most up-to-date usage of MSAL.js, while lacking detailed walkthroughs that might be necessary for new users. To review them, please refer to the /samples directory.

Featured Samples

Samples here provide a more friendly introduction for setup and running, as well as explanation about how the code works.

Sample Features Level Description
javascript-graphapi-v2 msal-core Basic VanillaJS single-page application calling the Microsoft Graph using msal.js (Azure AD V2 endpoint).
javascript-v2 msal-browser Basic VanillaJS single-page application using MSAL.js v2.x and OAuth 2.0 Authorization Code Flow with PKCE on Microsoft identity platform.
b2c-javascript-msal-singlepageapp msal-core Basic B2C single-page application calling a web API protected by Azure AD B2C.
javascript-singlepageapp-angular msal-angular Basic Angular single-page application demonstrating how to login, logout, protect a route, and acquire an access token for a protected resource such as Microsoft Graph.
b2c-javascript-angular-spa msal-angular Basic B2C Angular single-page application calling a web API protected by Azure AD B2C.
javascript-angular-spa-aspnetcore-webapi msal-angular Intermediate Angular single-page application which authenticates users with Azure AD and calls a protected ASP.NET Core web API.
javascript-react-spa-dotnetcore-webapi-obo msal-core Intermediate React single-page application which authorizes an ASP.NET Core web API to call MS Graph API on its behalf.
ms-identity-javascript-angular-spa-aspnet-webapi-multitenant msal-core Advanced Multi-tenancy tutorial demonstrating how to expose your app to users from other tenants, provide consent as admin and deploy it on Azure App Services.

Other Featured Samples

For a full list MSAL code samples targeting JavaScript, .NET, Java, Python, Node, iOS, Android and other platforms, please refer to Microsoft identity platform code samples.