How can users automatically login using form authentication and active directory on ASP NET 4.0?
Hey guys! I am under development of a web application in Asp in which I’m using form authentication with active directory users on a domain. Everything’s going cool without any issue but there’s a new greed in me these days. :P.
I wanted certain users to log in automatically if he/she is a part of a certain group. I know to check if the user belongs to a group but how do we log in the user into the application?
Re: How can users automatically login using form authentication and active directory on ASP NET 4.0?
There’s nothing to call it greed. Anyways, it’s a very simple thing to do. All you need to do is use Windows authentication. This will definitely fulfill your so called ‘Greed’ ;)
Re: How can users automatically login using form authentication and active directory on ASP NET 4.0?
No! I cannot use the windows authentication as I need the user to be able to login manually with other name and password.
Re: How can users automatically login using form authentication and active directory on ASP NET 4.0?
If you have used Form authentication before, it’s no big deal! In IIS you will need to enable Integrated Windows Authentication and disable anonymous access
You can simply check for codes online to find appropriate solution. The first or second page of Google must fetch you what you need.
In the global.asax file, you can place your code that does the lookup in the role database in the Application_AuthenticateRequest sub or possibly even the Session_Start. You can also provide some code that loads the users memberof and check for memberships to group sand assign a custom role if they belong to a group in AD.