forms authtentication on a directory

Discussion in 'ASP.NET / ASP.NET Core' started by Daithiw, Sep 9, 2005.

Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.
  1. Has anyone come across this..any help would be grateful

    I have a site that uses form authtentication on a directory.

    It simply forces the user to login to access a directory, however It doesn't seens to allow entry to the directory and keeps bouncing the user back to the login page.
    Noone can enter the directory without logging in as its forces authentication but nobody can.
    I have tried to trap the error, but there is no exception. eg:



    Try


    FormsAuthentication.SetAuthCook<WBR>ie(UID,
    True)


    FormsAuthentication.RedirectFro<WBR>mLoginPage(UID,
    True)



    Catch exc As Exception


    loginerror.Text = "Form Auth Error:" + exc.ToString()






    End Try


    To me it seems 'as if'the servernot issuing the cookies to allow access to the securedirectory. It validates the user but doesn't give them permissions to enter. Here is a piece of my web.config. Its works on the two servers I've tested this on but not on discountasp.net servers. I'm pretty sure its not a coding issue as it works when I follow it in debug on my dev enviornment and it works on my test server.

    sample from root directory web.config

    <system.web>


    <compilation debug="true"/>


    <authentication mode ="Forms">


    <forms loginUrl = "/userlogin.aspx" name = ".ASPXFORMSAUTH"/>


    </authentication>


    </system.web>





    <location path="dir1">


    <system.web>





    <authorization>


    <deny users="?" />


    </authorization>


    </system.web>
     
  2. Bruce

    Bruce DiscountASP.NET Staff

    Hmmm.. this looks fine to me!

    If you do not get any error but it keeps sending your back to the login page, it seems to me that it could be that the session is immediately logged out. I've seen this problem before with one of our application, say if you need to access this page (logout.aspx), form authentication will send you back to /login.aspx?returnURL=logout.aspx. When you login , it gets redirected to logout.aspx which in turn sends you back to the login page. This is highly speculative but it's possible that the application somehow call the logout routine.

    Bruce

    DiscountASP.NET
    www.DiscountASP.NET
     
  3. I am also having this problem. I will try to disable the authentication and see if that lets me in.


    If so hopefully there is a way around this, since we would like to retain this capability.





    chuck
     
Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.

Share This Page