简体   繁体   中英

Azure AD Multi Tenant Authentication - ASP.NET MVC 5

I have followed This tutorial to create a sample app that authenticates using Azure AD. However, I have changed multiple things since I wanted to implement it for multi-tenant. I did the following things different from the tutorial:

  1. Used 'common' as the tenant in web.config

  2. Used ' https://login.microsoftonline.com/common/ ' as an aad instance on web.config

The app works fine. I am redirected to the URL above for logging and redirected back as well. But the user context is still blank. (ie. Request.IsAuthenticated / User.IsAuthenticated is blank even after user is successfully authenticated)

Any help is appreciated.

Seems in this case the authentication was failing in issuer validation. In applications that allow any tenant to sign in, disabling issuer validation is an okay choice.

If you do want to limit the tenants that can sign in, don't disable it. Instead you would need to implement custom issuer validation.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM