Hello @Mayank Saxena
Thanks for reaching out!
Based on my research, the error AADSTS65001 usually occurs when you missed granting admin consent to the added scope while retrieving access token.
To resolve the error, please check whether you exposed the API like below:
Go to Azure Portal -> Azure Active Directory -> App Registrations -> Your App -> Expose an API
After exposing the API, make sure to grant API permissions for it like below:
Go to Azure Portal -> Azure Active Directory -> App Registrations -> Your App -> API permissions -> Add a permission -> My APIs -> Your API
After adding API permissions, make sure to grant admin consent if it is required.
As you are trying to get access token, please check whether you enabled the below options:
Go to Azure Portal -> Azure Active Directory -> App Registrations -> Your App -> Authentication
Note: Please make sure to add your client application to known client applications list
Refer these for more details:
- https://learn.microsoft.com/en-us/azure/active-directory/develop/reference-aadsts-error-codes#aadsts-error-codes
- https://github.com/MicrosoftDocs/azure-docs/issues/33008
- https://learn.microsoft.com/en-us/answers/questions/545439/index.html
Hope this helps.
If the answer is helpful, please click Accept Answer and kindly upvote it. If you have any further questions about this answer, please click Comment.