asp.net - Automatically logging into and out of FBA SharePoint site -


We have found a WSS 3.0 site which is using form based authentication (FBA). We want to set up the site so that some users can be logged in automatically, then get the login screen, and I am not the best way to do this.

Actually, I have already created an HTTP module that handles logging. More specifically, I have created an alternate login page, and when that page hits it logs it as the desired user, but this keeps logging the user after closing the browser, I start the browser, go to the alternate login page, my html module code gets triggered and logs as a desired user, then I close the browser When I try to go to the site, the standard login page of the site is left because I am previously logged in as a user in the form of a site.

I think my question may come down, I'm sure I'm logging off? Is there a way to do it with HTTP modules / handlers or do I want to do something in the world? Ax?

make a fool of me I had been set on the cookie parameter my FormsAuthentication.RedirectFromLoginPage command True. This means that the authentication cookie will continue for 50 years. What I wanted was to remove cookies when the browser was off. This is done easily if the cookie parameter is set to false. If there is any interest then my code is here ...

Importing the system. Web import system Web. Security import system Selection. Specific import system Security. Principal import system. Threading importing system Web .UI public class AuthModule Implements IHttpModule public sub Settlement () application as System.Web.IHttpModule.Dispose End Sub Public Sub Init (ByVal System.Web.HttpApplication) Implements System.Web.IHttpModule.Init AddHandler app.PreRequestHandlerExecute, New eventhandler Implements (AddressOf OnPreRequestHandlerExecute) End sub public sub OnPreRequestHandlerExecute (ByVal as this object, to see if _ ByVal e as EventArgs) 'alternative page HttpContext.Current.Request.Url.ToString.ToUpper.EndsWith ( " Automatic login has been accessed Do Aँc. As ASPX ") then" alternate page has been reached, so using predefined account log recover in 'username and Pasvor d Dim userName String = "user" dim userPassword String = "password" as' build user ID (user name in roles as string () is not too dim = something as retarded webIdentity New GenericIdentity, "letter") dim principal Yu as GenericPrincipal (webIdentity, roles) to assign the user HttpContext.Current.User = principal thread.CurrentPrincipal = principal 'Redirect the Start page login page "note, it was wrong in the line that I started. That is, I had another parameter set to 'true', which would continue the authentication cookie 'setting the second parameter to false would be the reason for' authentication cookie ', when the browser would be closed. Yes! FormsAuthentication.RedirectFromLoginPage (HttpContext.Current.User.Identity.Name.ToString, False) End If End Sub End Class

Comments

Popular posts from this blog

c++ - Linux and clipboard -

What is expire header and how to achive them in ASP.NET and PHP? -

sql server - How can I determine which of my SQL 2005 statistics are unused? -