Team,
I am trying to call a D365 FO WEB API from Postman and getting '401 unauthorized' error.
Steps 1:
Note: I have used Bearer token option, API permissions are granted on App registeration, I am trying to connect Tier 1 development server
URL used to retrieve token: https://login.microsoftonline.com/TenantId/oauth2/token
Body of request:
client_id - Azure App client id
grant_type - client_credentials
resource - D365 URL (Without slash at end)
client_secret - App secret
After sending the above HTTP request, I received a token
Step 2:
Also on the environment event viewer, this was the exact error message.
/'Can read the token but failed validating token with exception 'The token issuer https://sts.windows.net/tenantid/ is not valid, only the following issuers are allowed: (Listed some other tenants where my app and server not hosted)//
Please let me know what I am missing