Steps to Create an OAuth App in Azure Active Directory
- Sign in to the Microsoft Entra admin center as at least a Cloud Application Administrator.
- If you can access multiple tenants, use the Settings icon in the top menu to switch to the tenant where you want to register the application from the Directories + Subscriptions menu.
- Navigate to Entra ID > App registrations and select New Registration.

- Enter a display Name for your application. Users of your application might see the display name when they use the app, for example, during sign-in. You can change the display name at any time. Select Supported account types ( who can use the application). Select Register to complete the initial app registration.

- When registration finishes, the Microsoft Entra admin center displays the app registration's Overview.
- Navigate to API Permissions and click Add a Permission ( and remove User.Read delegated type permission as shown below).


- Select Microsoft Graph and click Application permissions to add all required scopes.


- Select all these scopes mentioned below and click Add Permissions.
"<https://graph.microsoft.com/RoleManagement.Read.Directory>"
"<https://graph.microsoft.com/User.Read.All>"
- Grant access to all these scopes for your app as shown below.

-
Navigate to Certificates & secrets → Client secrets → New client secret.

-
Copy the Secret value.