Re: Problem deploying forms authorization



Thanks for your reply Haim,

After some further speculation, I think I somewhat figure out the problem
you're encountering. Yes, it does be somewhat caused by the Login Control,
however, you can still use the login control with your own authentication
logic(and suppress the built-in membership/role providers'). To do so, you
should perform as below:

** For the Login Control, you should use the "LogginIn" event instead of
"Authenticate" event, because in LogginIn event, you can cancel the event
so that it won't execute further to call built-in membership providers.

** Here is the pseudocode code logic of the "logginIn" event:

=================
protected void Login1_LoggingIn(object sender, LoginCancelEventArgs e)
{
//do your database query and username/password validation here

//use FormsAuthentications.XXX method to establish
authentication ticket

//cancel the event so that it won't execute down furthe to call
built-in membership provider
e.Cancel = true;

}
=========================

** For the code about "use FormsAuthentications.XXX method to establish
authentication ticket", you can refer to the articles(that mentioned
manually use Forms Authentication api to generate authentication cookies) I
mentioned in previous reply.

If you still have anything unclear, please feel free to let me know.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead


This posting is provided "AS IS" with no warranties, and confers no rights.




.



Relevant Pages

  • Re: What Determines the Default Page (And How to Change)?
    ... it appears they just get taken to the login page even though they are already logged in and authentication code withing default.aspx would never get a chance to run. ... "Jonathan Wood" wrote in message ... I implemented this by redirecting the user to the appropriate home page in the handler for the LoggedIn event of the Login control. ... For example, if I check the Remember Me box and then disconnect and then reconnect, I go straight to default.aspx in the root folder withough having to log in again. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: can someone explain this weird behaviour?
    ... IIS to also authenticate with another protocol before even allowing ... authentication scheme seems confusing, and I agree -- and that is why ... The "Dir Security" property you change is one of the ... But for the same asp.net application with the same login control etc.. ...
    (microsoft.public.inetserver.iis.security)
  • Re: Forms authentication credentials fail
    ... the login control does not work againt the section in web.config ... handle the authenticate event of the login control and call FormsAuthentication.Authenticate ... I have a site with an admin folder that is protected with forms ... to use my own user authentication for the rest of the site. ...
    (microsoft.public.dotnet.framework.aspnet.security)
  • Re: Image not showing in MasterPage during login
    ... I have the login control on a page (login.aspx ... Authentication began blocking access to all files, ... If you figure out the original reason, ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Image not showing in MasterPage during login
    ... I have the login control on a page (login.aspx ... there's probably some mind-boggling reason I missed. ... Authentication began blocking access to all files, ...
    (microsoft.public.dotnet.framework.aspnet)