1.

How to implement Forms authentication in ASP.NET MVC?

Answer»

AUTHENTICATION means providing access to the user for a particular service through verification of his/her identity using his/her credentials such as email-id and password or username and password. It will make sure that the correct user will be authenticated or logged in for a particular service and the right service will be GIVEN to the specific user depending on their role.

Forms authentication in ASP.NET will be done after the completion of IIS(Internet Information Services) authentication. It is possible to configure forms authentication with the help of the forms element in the file web.config of your application. 

The forms authentication default attribute values are given below:

<system.web&GT; <authenticationmode="Forms"> <formsloginUrl="Login.aspx" protection="All" timeout="30" name=".ASPXAUTH" path="/" requireSSL="false" slidingExpiration="true" defaultUrl="default.aspx" cookieless="UseDeviceProfile" enableCrossAppRedirects="false" /> </authentication></system.web>

The FormsAuthentication class will automatically create the authentication cookie when it calls the methods RedirectFromLoginPage() or SetAuthCookie(). The value of an authentication cookie will be having the STRING representation for the signed and encrypted FormsAuthenticationTicket object.



Discussion

No Comment Found