2 thoughts on “Double confirm identity with ASP.NET Identity

  1. Pedro Sousa Pinto

    Hi there! Awesome post! 🙂 Tks a lot! Also, i’ve got a question! Is it possible to have in one application with Asp Net Identity two logins based on the area the user is? For example, a person logs in the backoffice has an administrator but if he tries to access the frontoffice area he is prompted with the frontoffice login. Thanks in advance!

  2. Boyan Mihaylov

    Hi Pedro. Thank you for your question. It is indeed possible to achieve this, though not with the method presented in this post. You need to “copy” some logic from FormsAuthentication mechanism in C#. You could issue a special cookie for your front-end part, which would mean the user is logged in there. You should also make sure you replace the principal of every request (you could create a principle with two identities). Another approach is to uses roles: for your front-end part you assign the user role, while for the back-end part you assign the admin role. Hope this helps you 🙂