
Enter_the_Tenant_Info_here should be one of the following parameters:. For national clouds (for example, China), you can find appropriate values in National clouds. For the main (or global) Azure cloud, enter (include the trailing forward-slash). Enter_the_Cloud_Instance_Id_Here: The Azure cloud instance in which your application is registered. REDIRECT_URI=" POST_LOGOUT_REDIRECT_URI=" GRAPH_API_ENDPOINT="Enter_the_Graph_Endpoint_Here" # graph api endpoint string should end with a trailing slashĮXPRESS_SESSION_SECRET="Enter_the_Express_Session_Secret_Here"įill in these details with the values you obtain from Azure app registration portal: Then add the following code:ĬLOUD_INSTANCE="Enter_the_Cloud_Instance_Id_Here" # cloud instance string should end with a trailing slashĬLIENT_ID="Enter_the_Application_Id_Here"ĬLIENT_SECRET="Enter_the_Client_Secret_Here" env file in the root of your project folder. Install these via npm: npm install -save express-session dotenv axios The web app sample in this tutorial uses the express-session package for session management, dotenv package for reading environment parameters during development, and axios for making network calls to the Microsoft Graph API. Locate the root of your project directory in a terminal and install the MSAL Node package via npm. The file and folder structure of your project should look similar to the following folder structure: ExpressWebApp/ Then, create an application skeleton as follows:Įxpress -view=hbs /ExpressWebApp & cd /ExpressWebApp. First, install the express-generator package:.
Use the Express application generator tool to create an application skeleton.
Client secret: ********* (record this value for use in a later step - it's shown only once). Supported account types: Accounts in this organizational directory only. Use the following settings for your app registration:
Visual Studio Code or another code editorįirst, complete the steps in Register an application with the Microsoft identity platform to register your app. Install the authentication library packagesįor more information, see the sample code that shows how to use MSAL Node to sign in, sign out and acquire an access token for a protected resource such as Microsoft Graph. Register the application in the Azure portal.