Question

I just want to check if there's any reason what I'm proposing won't work. I'm migrating an existing site with an existing membership base to MVC and want to make use of Asp.net Identity and the OWin based authentication. These site users will authenticate against the database and I've build a User Store and persistance logic for this

But for certain users (site admins) I need to also auth against Azure Active Directory. I want to Auth against active directory on a certain folder/url which will be different from the main auth logic for the site (login can happen normally from anywhere)

Is there any problem firstly with using 2 different sources for my auth on the same library, and secondly two different login locations for my procedure (Active directory on a specific URL and database from anywhere else) I expect the configuration to be a bit tricky but not impossible.

Thanks in advance

Was it helpful?

Solution

Absolutely possible. See the sample here, and specifically the SecurityTokenValidated handler in Startup.Auth.cs, for a good starting point.

https://github.com/AzureADSamples/WebApp-MultiTenant-OpenIdConnect-DotNet

-- Rich

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top