Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AADSTS7000012: The grant was obtained for a different tenant

When I try to connect with Microsoft graph with a personal acount, I get this error message: AADSTS7000012: The grant was obtained for a different tenant.

I am following this tutorial https://github.com/Azure-Samples/ms-identity-java-webapp/tree/master/msal-java-webapp-sample, and it works fine with professional account.

Also I don't find any documentation on this AADSTS7000012 error code!

like image 465
Najim Lagmiri Avatar asked Dec 06 '25 08:12

Najim Lagmiri


1 Answers

I found the solution, for my case i had to use this url : https://login.microsoftonline.com/common/

For organizations only the url must be : https://login.microsoftonline.com/organizations

And only for the same tenant of the organization : https://login.microsoftonline.com/{tenantId}

like image 120
Najim Lagmiri Avatar answered Dec 07 '25 21:12

Najim Lagmiri