Skip to content

Latest commit

 

History

History
49 lines (35 loc) · 2.03 KB

active-directory-develop-guidedsetup-javascriptspa-introduction.md

File metadata and controls

49 lines (35 loc) · 2.03 KB
title description services documentationcenter author manager editor ms.service ms.devlang ms.topic ms.tgt_pltfrm ms.workload ms.date ms.author ms.custom
include file
include file
active-directory
dev-center-name
navyasric
mtillman
active-directory
na
include
na
identity
09/17/2018
nacanuma
include file

Call the Microsoft Graph API from a JavaScript single-page application (SPA)

This guide demonstrates how a JavaScript single-page application (SPA) can sign in personal, work and school accounts, get an access token, and call the Microsoft Graph API or other APIs that require access tokens from the Azure Active Directory v2.0 endpoint.

How the sample app generated by this guide works

How the sample app generated by this guide works

More Information

The sample application created by this guide enables a JavaScript SPA to query the Microsoft Graph API or a Web API that accepts tokens from Azure Active Directory v2.0 endpoint. For this scenario, after a user signs in, an access token is requested and added to HTTP requests through the authorization header. Token acquisition and renewal are handled by the Microsoft Authentication Library (MSAL).

Libraries

This guide uses the following library:

Library Description
msal.js Microsoft Authentication Library for JavaScript Preview

Note

msal.js targets the Azure Active Directory v2.0 endpoint - which enables personal, school and work accounts to sign in and acquire tokens. The Azure Active Directory v2.0 endpoint has some limitations. To understand differences between the v1.0 and v2.0 endpoints read the Endpoint comparison guide.