Prerequisites:
- The Redirect URL for your tenant
- A user in Microsoft 365 with administrative privileges
Setup
- Sign in to https://entra.microsoft.com/
- Navigate to Enterprise applications and select New application, followed by Create your own application

- Fill in a suitable name, select the Non-gallery option and click Create

- Configure the new application according to your needs and company policy
- Navigate to App registrations and under All applications, select the newly created application

- In the Overview, note down the Client ID and Tenant ID

- In the Authentication pane, click Add a platform → Web and add the Redirect URL.
Unselect Access and ID tokens under Implicit grant and click Save

- Under Certificates & secrets, select New client secret.
Fill in an appropriate name for the secret, and set Expirery to 24 months
Make a note of the Client Secret (Value). Not the Secret ID

- Under API permission select Add a permission → Microsoft Graph →Delegated permissions
Select all 4 OpenId permissions as shown bellow. Click Add permissions.
