I am new to Azure Portal,I have premium p2 subscription, I want to generate a token using Client Credentials flow type, Basically want to read my application and users associated with my Tenant. I am using Postman for calling API.
I tried but not able to achieve desired output.I am confused with which API should I call.
Created an Microsoft Entra ID Application like below:
Note: If you want to read all users and applications of tenant , Add permissionUser.Read.All
and Application.Read.All
.
Adding Application.Read.All
and User.Read.All
like below:
Now you need to generate Access Token by Postman
GET https://login.microsoftonline.com/{tenant-id}/oauth2/v2.0/token
client_id: <application id>
client_secret: <client secret>
grant_type: client_credentials
scope: https://graph.microsoft.com/.default
Generated Access Token:
After Successfully generating access token, Now use the Access token to list Users and Application in Tenant.
1. List the User
GET https://graph.microsoft.com/v1.0/users
2.List the Applications
GET https://graph.microsoft.com/v1.0/applications
References: