Problem
Recieived the below error when I try to get Microsoft Graph access token with my Azure AD Application using OAuth 2.0 client credentials grant flow.
Token identity endpoint URL : https://login.microsoftonline.com/xxxxxx/oauth2/v2.0/token "error":"invalid_request","error_description":"AADSTS90002: Tenant 'xxxxxx' not found. This may happen if there are no active subscriptions for the tenant. Check with your subscription administrator
Fix/Solution
We need to provide either TenantID (Guid) or Tenant DomainName (ex: xxxxx.onmicrosoft.com) in token identity endpoint URL to get access token. But in my case, I have just provided tenant name alone instead of tenant domain name/tenantId, the problem solved after providing complete tenant domain name.
#Token endpoint URL with tenant domain name https://login.microsoftonline.com/xxxxxx.onmicrosoft.com/oauth2/v2.0/token #Token endpoint URL with tenant id (guid) Token identity endpoint URL : https://login.microsoftonline.com/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/oauth2/v2.0/token
To find your tenant id, you can refer this post : How to find your Office 365 Tenant ID
Advertisement