To run the completed project in this folder, you need the following:
- Java SE Development Kit (JDK) and Gradle installed on your development machine. If you do not have the JDK or Gradle, visit the previous links for download options. (Note: This tutorial was written with OpenJDK version 14.0.0.36 and Gradle 6.7.1. The steps in this guide may work with other versions, but that has not been tested.)
- A Microsoft work or school account.
If you don't have a Microsoft account, you can sign up for the Microsoft 365 Developer Program to get a free Microsoft 365 subscription.
-
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.
-
Select Azure Active Directory in the left-hand navigation, then select App registrations under Manage.
-
Select New registration. On the Register an application page, set the values as follows.
- Set Name to
Java Graph Tutorial. - Set Supported account types to Accounts in any organizational directory.
- Leave Redirect URI empty.
- Set Name to
-
Choose Register. On the Java Graph Tutorial page, copy the value of the Application (client) ID and save it, you will need it in the next step.
-
Select the Add a Redirect URI link. On the Redirect URIs page, locate the Suggested Redirect URIs for public clients (mobile, desktop) section. Select the
https://login.microsoftonline.com/common/oauth2/nativeclientURI. -
Locate the Default client type section and change the Treat application as a public client toggle to Yes, then choose Save.
- Rename the
oAuth.properties.examplefile tooAuth.properties. - Edit the
oAuth.propertiesfile and make the following changes.- Replace
YOUR_APP_ID_HEREwith the Application Id you got from the App Registration Portal.
- Replace
In your command-line interface (CLI), navigate to the project directory and run the following commands.
./gradlew --console plain run



