Azure Active Directory passes empty GUID for tenantId with default template

I have tried this with multiple MS accounts that have Azure / AAD accounts and have tried using both Visual Studio 2015 and 2017 and I am getting the same error / error.

Using the ASP.NET default ASP.NET template with AAD integration out of the box (no code changes at all). The app is registered with my AAD account and I can see the tenantId and other GUIDs are in the Web.Config as they should. I also tracked the call stack as far as I could and the tenantId initialized correctly, but I still get this error:

The requested tenant ID '00000000-0000-0000-0000-000000000000' is invalid. Tenant IDs may not be a blank GUID.

This happens after the accept permissions screen.

Here's a screenshot:

enter image description here

As requested, here is the Web.Config:

enter image description here

+2


source to share


1 answer


Thus, the resolution was very simple. But this is not documented anywhere, not even in Vittorio Bertocci's book on the subject, which leads you to believe that you can log in as an Azure subscription owner after creating a Visual Studio project without any additional setup in Azure.

Since the new portal is in preview, the UX isn't really all that obvious. Following are the steps to take after creating a new ASP.NET project with Active Directory integration:



  • You need to sign in to Azure (in the new portal)

  • Click Active Directory.

  • Go to Application Registration

  • You will see your new application. click on it.

  • Inside the "Essentials" panel at the top of the application registration window, you will see a link titled "Managed application in local directory" and the link will have the same name as the blade you are already in (this is the confusing part) . Click on this link ...

  • Now you become one click and you can see how many users this application has. It will probably be 0 . - This is a problem!

  • Click the "Users and Groups" button in the left menu and you can start adding users.

Please note that the above steps may change as AAD exits preview in the new portal.

0


source







All Articles