Quantcast
Channel: Azure Active Directory forum
Viewing all articles
Browse latest Browse all 16000

Is there a way to use Identity 2.0 AspNetUsers Authentication (Azure SQL) AND OpenIdConnect (to use Azure Active Directory)?

$
0
0

I don't feel like I've found the right Forum... Suggestions?

The big idea... A user inputs their email to sign in. We look to see whether their company uses Azure Active Directory (Azure AD) or not. If they do, go to Microsoft to sign in. If not, sign in using Identity 2.0 and the AspNetUsers table in Azure SQL database.

Seems doable... You can send the users to different sign in pages based on their company profile and call this if they use Azure AD...  
HttpContext.GetOwinContext().Authentication.Challenge(      new AuthenticationProperties { RedirectUri = "/" },   OpenIdConnectAuthenticationDefaults.AuthenticationType);
Or call this if they don't use Azure AD...
 var result = await SignInManager.PasswordSignInAsync(model.Email, 
             model.Password, model.RememberMe, shouldLockout: ShouldLockout);

The problem? In wiring up the Authentication, you can only use a single `cookiesAuthenticationOptions` in `app.UseCookieAuthentication(cookieAuthenticationOptions)`.

And it seems that these two methods of signing in have very different options.

Is there a way to have these two authentication techniques peacefully coexist?

Or must one choose one or the other?


Viewing all articles
Browse latest Browse all 16000

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>