Forms Authentication - Does Not Redirect

Ask a Question related to ASP.NET Security, Design and Development.

  1. #1

    Default Re: Forms Authentication - Does Not Redirect

    Elmo,

    Perhaps you are missing the "allow" child node in your web.config file?

    <authorization>
    <deny users="?" /> <!-- denies anonymous access -->
    <allow users="*, YourRoleName, SomeUsername, Etc" /> <!--allows all
    authenticated users -->
    </authorization>

    According to MSDN: "The default authorization rule in the Machine.config
    file is <allow users="*"/> so, by default, access is allowed unless
    configured otherwise." Looks like you forgot to include an allow tag.

    -Steve

    "ElmoWatson" <sputnik75043@yahoo.com> wrote in message
    news:OQBUeEsVDHA.2544@tk2msftngp13.phx.gbl...
    > Here's my problem - - I'm trying to setup Forms Authentication on my
    server.
    > I can get the login page to show up every time, but, when it authenticates
    > (I have a database lookup setup, which apparently DOES give back good
    data),
    > it just refreshes the login page, deleting the username & password.
    >
    > I know the database routine works. It returns a user's account properties,
    > if verified and nothing, if not - - then, if it returns data from the
    > database, I set 'blnValidUer' to True - otherwise, I set it to false. This
    > is working as expected.
    > Then, I do this in my code:
    > if blnValidUser="True" then
    > FormsAuthentication.RedirectFromLoginPage(txtUID.t ext, True)
    > (I've also tried -----'response.Write (request.QueryString
    > ("ReturnURL") & "<br>")
    > else
    > lblError.text="We're sorry, but the information you provided does not
    > match our database. Please try again."
    > End If
    >
    > Here's my Web.config Code:
    > <authentication mode="Forms">
    > <forms name="MySite"
    > loginUrl="login.aspx"
    > protection="All"
    > timeout="480"
    > path="/"
    > />
    > </authentication>
    > <authorization>
    > <deny users="?" />
    > </authorization>
    > I checked an earlier post - - my webserver is named normally, with nothing
    > but letters (no underscores, etc) - - so that's not the problem
    >
    > Is there something I'm missing here? Why doesn't it redirect correctly?
    >
    >

    Steve Jansen Guest

  2. Similar Questions and Discussions

    1. Forms Authentication won't redirect to login page
      I'm trying to set basic form authentication on a webapp. I allaccess restricted to authenticated users. After changing theWeb.config file in the...
    2. Redirect fails with Forms Authentication
      Geezuz, I feel like a fool but I can't get this SIMPLE redirect out of IIS to hit my login page. Here's the Web.Config code: <authentication...
    3. ASP.Net Forms authentication with basic authentication popup
      Relatively new to ASP.Net but have a strange problem. My site uses forms authentication for a large administration section however after the user...
    4. Forms authentication then redirection to a secure web with NT authentication?
      Hi, I want to allow access to particular secured intranet web sites. These intranet are stored in sharepoint (2003 version) Actually I've...
    5. Authentication ticket, cookieless, forms authentication?
      Hi. I want to use Forms Authentication, cookieless. The issue is setting the Authentication Ticket without using cookies (!) That is, the...
  3. #2

    Default Re: Forms Authentication - Does Not Redirect

    Has anyone got any ideas on this? I still can't seem to get it to redirect
    after authentication......(it still just refreshes the login page)

    "ElmoWatson" <sputnik75043@yahoo.com> wrote in message
    news:Of%236NGtVDHA.1680@tk2msftngp13.phx.gbl...
    > OK - but I need to just allow users, once they've been authenticated
    through
    > my database query...
    > I tried adding:
    > <allow users="*"/>
    > But that doesn't work either. Or I should say, that it works the same was
    as
    > before - it still just refreshes the Login page
    >
    > I'm not sure what to put in place of names, after the asterisk, in this
    > case......
    >
    > How can I procede here?
    >
    > "Steve Jansen" <stj3@nospam.columbia.edu> wrote in message
    > news:%23r4jkpsVDHA.2224@TK2MSFTNGP09.phx.gbl...
    > > Elmo,
    > >
    > > Perhaps you are missing the "allow" child node in your web.config file?
    > >
    > > <authorization>
    > > <deny users="?" /> <!-- denies anonymous access -->
    > > <allow users="*, YourRoleName, SomeUsername, Etc" /> <!--allows all
    > > authenticated users -->
    > > </authorization>
    > >
    > > According to MSDN: "The default authorization rule in the Machine.config
    > > file is <allow users="*"/> so, by default, access is allowed unless
    > > configured otherwise." Looks like you forgot to include an allow tag.
    > >
    > > -Steve
    > >
    > > "ElmoWatson" <sputnik75043@yahoo.com> wrote in message
    > > news:OQBUeEsVDHA.2544@tk2msftngp13.phx.gbl...
    > > > Here's my problem - - I'm trying to setup Forms Authentication on my
    > > server.
    > > > I can get the login page to show up every time, but, when it
    > authenticates
    > > > (I have a database lookup setup, which apparently DOES give back good
    > > data),
    > > > it just refreshes the login page, deleting the username & password.
    > > >
    > > > I know the database routine works. It returns a user's account
    > properties,
    > > > if verified and nothing, if not - - then, if it returns data from the
    > > > database, I set 'blnValidUer' to True - otherwise, I set it to false.
    > This
    > > > is working as expected.
    > > > Then, I do this in my code:
    > > > if blnValidUser="True" then
    > > > FormsAuthentication.RedirectFromLoginPage(txtUID.t ext, True)
    > > > (I've also tried -----'response.Write (request.QueryString
    > > > ("ReturnURL") & "<br>")
    > > > else
    > > > lblError.text="We're sorry, but the information you provided does
    > not
    > > > match our database. Please try again."
    > > > End If
    > > >
    > > > Here's my Web.config Code:
    > > > <authentication mode="Forms">
    > > > <forms name="MySite"
    > > > loginUrl="login.aspx"
    > > > protection="All"
    > > > timeout="480"
    > > > path="/"
    > > > />
    > > > </authentication>
    > > > <authorization>
    > > > <deny users="?" />
    > > > </authorization>
    > > > I checked an earlier post - - my webserver is named normally, with
    > nothing
    > > > but letters (no underscores, etc) - - so that's not the problem
    > > >
    > > > Is there something I'm missing here? Why doesn't it redirect
    correctly?
    > > >
    > > >
    > >
    > >
    >
    >

    ElmoWatson Guest

  4. #3

    Default Re: Forms Authentication - Does Not Redirect

    Can you post the URL that is showing in the browers address window when you
    get the login screen.


    "ElmoWatson" <sputnik75043@yahoo.com> wrote in message
    news:eWsTJmGWDHA.1900@TK2MSFTNGP10.phx.gbl...
    > Has anyone got any ideas on this? I still can't seem to get it to redirect
    > after authentication......(it still just refreshes the login page)
    >
    > "ElmoWatson" <sputnik75043@yahoo.com> wrote in message
    > news:Of%236NGtVDHA.1680@tk2msftngp13.phx.gbl...
    > > OK - but I need to just allow users, once they've been authenticated
    > through
    > > my database query...
    > > I tried adding:
    > > <allow users="*"/>
    > > But that doesn't work either. Or I should say, that it works the same
    was
    > as
    > > before - it still just refreshes the Login page
    > >
    > > I'm not sure what to put in place of names, after the asterisk, in this
    > > case......
    > >
    > > How can I procede here?
    > >
    > > "Steve Jansen" <stj3@nospam.columbia.edu> wrote in message
    > > news:%23r4jkpsVDHA.2224@TK2MSFTNGP09.phx.gbl...
    > > > Elmo,
    > > >
    > > > Perhaps you are missing the "allow" child node in your web.config
    file?
    > > >
    > > > <authorization>
    > > > <deny users="?" /> <!-- denies anonymous access -->
    > > > <allow users="*, YourRoleName, SomeUsername, Etc" /> <!--allows all
    > > > authenticated users -->
    > > > </authorization>
    > > >
    > > > According to MSDN: "The default authorization rule in the
    Machine.config
    > > > file is <allow users="*"/> so, by default, access is allowed unless
    > > > configured otherwise." Looks like you forgot to include an allow tag.
    > > >
    > > > -Steve
    > > >
    > > > "ElmoWatson" <sputnik75043@yahoo.com> wrote in message
    > > > news:OQBUeEsVDHA.2544@tk2msftngp13.phx.gbl...
    > > > > Here's my problem - - I'm trying to setup Forms Authentication on my
    > > > server.
    > > > > I can get the login page to show up every time, but, when it
    > > authenticates
    > > > > (I have a database lookup setup, which apparently DOES give back
    good
    > > > data),
    > > > > it just refreshes the login page, deleting the username & password.
    > > > >
    > > > > I know the database routine works. It returns a user's account
    > > properties,
    > > > > if verified and nothing, if not - - then, if it returns data from
    the
    > > > > database, I set 'blnValidUer' to True - otherwise, I set it to
    false.
    > > This
    > > > > is working as expected.
    > > > > Then, I do this in my code:
    > > > > if blnValidUser="True" then
    > > > > FormsAuthentication.RedirectFromLoginPage(txtUID.t ext, True)
    > > > > (I've also tried -----'response.Write (request.QueryString
    > > > > ("ReturnURL") & "<br>")
    > > > > else
    > > > > lblError.text="We're sorry, but the information you provided
    does
    > > not
    > > > > match our database. Please try again."
    > > > > End If
    > > > >
    > > > > Here's my Web.config Code:
    > > > > <authentication mode="Forms">
    > > > > <forms name="MySite"
    > > > > loginUrl="login.aspx"
    > > > > protection="All"
    > > > > timeout="480"
    > > > > path="/"
    > > > > />
    > > > > </authentication>
    > > > > <authorization>
    > > > > <deny users="?" />
    > > > > </authorization>
    > > > > I checked an earlier post - - my webserver is named normally, with
    > > nothing
    > > > > but letters (no underscores, etc) - - so that's not the problem
    > > > >
    > > > > Is there something I'm missing here? Why doesn't it redirect
    > correctly?
    > > > >
    > > > >
    > > >
    > > >
    > >
    > >
    >
    >

    Stage Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139