Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MVC 5 use old forms authentication instead of OWIN

How can i use the forms authentication found in asp.net mvc 3/4 in mvc 5 ?

I have an mvc 4 app that i want to hook up with admin dashboard in mvc 5 and eventually convert the main app to mvc 5 but i want to keep the authentication AS IS or convert it somehow to the new auth method.

I searched for a while but all i found was on how to use the new OWIN authentication ( imo ms` version of dotnetopenauth). If you guys know a link with useful info or can answer me here, please do so.

Thanks!

like image 708
Nikola Sivkov Avatar asked Nov 18 '13 21:11

Nikola Sivkov


People also ask

What is the Authentication Manager in OWIN formsauthentication?

If you’ve used FormsAuthentication in ASP.NET you know that there’s a global object that handles management of the user tracking cookie that associates a user with an account. OWIN has its own version of an authentication manager in the IAuthenticationManager interface which is attached to the HttpContext object.

Is my MVC 5 application running successfully?

Congratulations, your MVC 5 application ran successfully. Click on restore down the browser page you can see like following: Because of the MVC 5 new feature Bootstrap. Several common authentication techniques are not secure on plain HTTP. Like basic authentication, forms authentication and unencrypted credentials.

How to authenticate a form user using middleware?

After the user provides credentials, your application code will validate the user name and password and build user claims including user’s name, roles, etc. After passing claims to the Forms authentication middleware, it will convert it to an application ticket and serialize, encrypt and encode it into a ticket token. Then, send it out as a cookie.

How to configure MVC authentication in ASP NET?

· In New ASP.NET Project dialog, select MVC project template Optional: On the right panel of the dialog, you can select Configure Authentication, to choose No Authentication, Individual User Accounts, Organization Authentication and Windows Authentication. In this tutorial, we use Individual User Accounts, which is the default setting.


1 Answers

I was able to get both, OWIN and Forms, to work together by doing this: MVC 5 External authentication with authentication mode=Forms

like image 97
Felipe Miosso Avatar answered Oct 21 '22 22:10

Felipe Miosso