I'm attempting to use the OWIN Open ID Connect middleware to outsource authentication for my ASP.NET application to Azure Active Directory. The application successfully redirects to the Azure AD sign-in page upon accessing a page that requires authorisation. However upon signing in to Azure AD I'm encountering the following error:
AADSTS90002: Requested tenant identifier '00000000-0000-0000-0000-000000000000' is not valid. Tenant identifiers may not be an empty GUID.
Here is the call to UseOpenIdConnectAuthentication
. The tenant which is included in the Authority URL is f82d0e29-6018-43c6-b806-1f46a009ff4a. So why does Azure AD think I am passing in an empty GUID for the tenant?
app.UseOpenIdConnectAuthentication(new OpenIdConnectAuthenticationOptions
{
AuthenticationType = "AzureAd",
Caption = "Office 365",
Scope = "openid email profile",
ClientId = "e34401b2-6a9f-4547-9229-f0d93a33b1a1",
Authority = "https://login.windows.net/f82d0e29-6018-43c6-b806-1f46a009ff4a/",
PostLogoutRedirectUri = "http://localhost:44333",
RedirectUri = "http://localhost:44333",
AuthenticationMode = AuthenticationMode.Passive,
SignInAsAuthenticationType = signInAsType
});