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 |
If you're not using Visual Studio, make sure your web server is started.
-
Configure the server to listen to a TCP port that's based on the location of your index.html file. For Node, start the web server to listen to the port by running the following commands on a command line prompt from the application folder:
npm install node server.js
-
Open the browser and type http://localhost:30662 or http://localhost:{port} where port is the port that your web server is listening to. You should see the contents of your index.html file and the Sign In button.
If you're using Visual Studio, make sure to select the project solution and press F5 to run your project. The browser opens to the http://localhost:{port} location and you see the Sign In button.
After the browser loads your index.html file, click Sign In. You will be prompted to sign in with the Microsoft Azure Active Directory (Azure AD) v2.0 endpoint:
The first time that you sign in to your application, you're prompted to provide your consent to allow the application to access your profile and to sign you in:
After you sign in, you should see your user profile information returned in the Microsoft Graph API response displayed on the page.
The Microsoft Graph API requires the user.read
scope to read a user's profile. This scope is automatically added by default in every application that's registered on the registration portal. Other APIs for Microsoft Graph, as well as custom APIs for your back-end server, might require additional scopes. For example, the Microsoft Graph API requires the Calendars.Read
scope to list the user’s calendars.
To access the user’s calendars in the context of an application, add the Calendars.Read
delegated permission to the application registration information. Then, add the Calendars.Read
scope to the acquireTokenSilent
call.
Note
The user might be prompted for additional consents as you increase the number of scopes.
If a back-end API doesn't require a scope (not recommended), you can use the clientId
as the scope in the calls to acquire tokens.
[!INCLUDE Help and support]