Authentication Keeps returning to Login Page

Discussion in 'ASP .Net Security' started by dave, Nov 10, 2003.

  1. dave

    dave Guest

    I have the following problem:

    my web.config file (see below) protects the entire website and when a user
    tries to go to a page they are redirected to the login - all is well..

    However, even though they have been authenticated it is still returning to
    the login page. However if i then go to the original page i wanted it will
    let me in, as i have now been authenticated, so that part is working...

    The login code is straight forward enough (see below), but i cannot for the
    life of me work out why it keeps returning to the login page. I have tried
    many variations to get me to the originally requested page, but no success.

    Thanks in advance..

    Web Config settings.

    <configuration>
    <system.web>
    <customErrors mode="Off"/>
    <pages smartNavigation="true"/>
    <compilation debug="true"/>

    <authentication mode="Forms" >
    <forms name="App1" path="/" loginUrl="login.aspx" >
    <credentials passwordFormat="Clear">
    <user name="tester" password="testing" />
    </credentials>
    </forms>
    </authentication>


    <authorization>
    <allow users="tester"/>
    <deny users="?"/>
    </authorization>
    </system.web>

    </configuration>


    Login Code.

    sub DoLogin(objSender as Object, objArgs As EventArgs)
    if FormsAuthentication.Authenticate(username.value, password.value) then
    formsauthentication.redirectfromloginpage(username.value, "False")
    end if
    end sub
    dave, Nov 10, 2003
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. BillGatesFan
    Replies:
    3
    Views:
    331
    Bill Gates Brother
    Jan 3, 2005
  2. Edward J. Stembler
    Replies:
    1
    Views:
    275
    Edward J. Stembler
    Aug 11, 2003
  3. Pascal Blanchard
    Replies:
    0
    Views:
    236
    Pascal Blanchard
    Aug 17, 2004
  4. Pascal Blanchard
    Replies:
    1
    Views:
    272
    Pascal Blanchard
    Aug 18, 2004
  5. Jason Burr

    MSXML problems keeps returning 400 when POST

    Jason Burr, Jan 13, 2004, in forum: ASP General
    Replies:
    2
    Views:
    178
    Jason Burr
    Jan 13, 2004
Loading...

Share This Page