Authentication Keeps returning to Login Page

From: dave (dave_at_edin.co.uk)
Date: 11/10/03


Date: Mon, 10 Nov 2003 17:36:48 -0000

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



Relevant Pages

  • Re: Open child form from dialog form
    ... found out that login failed in sub main? ... except I can't close login dialog. ... > Dim LoginForm As New LoginForm ... > I've set the button's dialogresult property in the designer. ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Secure Multiple Applications in one Domain
    ... Original Page, Login Page, Post of Login Page, Original Page, ... Is using the element in my root web's web.config file the way to ... > another sub application located in the ... Regarding on the repeatly be redirect to login page. ...
    (microsoft.public.dotnet.framework.aspnet.security)
  • Simple Login programming: Authentication does not work for me!
    ... I thought it should be a simple matter to put a login page together after watching LearnVisualNet videos! ... The Login1.Authenticate sub may not be necessary. ... Protected Sub Login1_LoggedIn(ByVal sender As Object, ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: web config problem!!!!
    ... I believe you could use the tag to get separate login pages for the admin and user sub folder.the location tag would go something like this: ... > folder has two sub folder named admin and user ...
    (microsoft.public.dotnet.framework.aspnet.security)
  • RE: Secure Multiple Applications in one Domain
    ... root applicaiton 's root folder in IIS. ... Now you want the sub application's file also be ... use the same login page in the root web application. ... Regarding on the repeatly be redirect to login page. ...
    (microsoft.public.dotnet.framework.aspnet.security)