I am following the steps as here: https://docs.microsoft.com/en-us/graph/auth-v2-service
I registered a mock app and added app permissions to Graph. None of the permissions require Admin Consent so I skipped that step.
I then called the API (from Postman) https://login.microsoftonline.com/{tenant_id}/oauth2/v2.0/token
using client_id, scope, client_secret, grant_type. For 'scope' i use 'https://graph.microsoft.com/.default' and for 'grant_type' the value is 'client_credentials'.
I get error:
"error": "invalid_request",
"error_description": "AADSTS9002331: Application 'xxxxxxxxxxx' is configured for use by Microsoft Account users only. Please use the /consumers endpoint to serve this request.\r\nTrace ID: 67375d76-2f9d-4fb1-b1dd-3286fad85a00\r\nCorrelation ID: e217e9ff-2696-495f-9657-f2bb1d7066cf\r\nTimestamp: 2020-09-18 07:46:39Z",
"error_codes": [
9002331
What I am missing ?
curl -X POST -d “grant_type=client_credentials&client_id=clientid&client_secret=secret&scope= https%3A%2F%2Fgraph.microsoft.com%2F.default” https://login.microsoftonline.com/tenantid/oauth2/v2.0/tokenand let us know if it helps - Sruthi J