Hi @Shubham Betterworks,
Thanks for reaching out.
From your query I understood that you are getting error when trying to acquire the token using console app.
This error generally occurs when scopes are not defined correctly, or admin consent has not been granted for the defined permissions.
Can you please check the below details:
-
- If your App type is Multi-tenant apps, set Tenant to "common": https://login.microsoftoneline.com/common, For single-tenant apps must use the tenant ID from the Azure portal: https://login.microsoftoneline.com/TenantID
- Is your app provisioned in the target tenant? If no, I am guessing you are calling in application-only context. For this, the admin of the tenant must consent to your application using the url: https://login.microsoftonline.com/common/oauth2/authorize?response_type=code&client_id=YOURAPPIDHERE&prompt=admin_consent. Once the consent is granted, a service principal for your application will be provisioned and you should be able to get a token with the right roles and information on it.
After by checking all the above provided details, if you are still facing the same issue, I would recommend you to raise a support case with Microsoft Graph, a Support Engineer will be able to assist you better. You can raise support ticket from [http://aad.portal.azure.com]/ or https://admin.microsoft.com/#/support/requests.
Hope this helps.
If the answer is helpful, please click Accept Answer and kindly upvote. If you have any further questions about this answer, please click Comment.