FormsAuthentication Redirection NOT WORKING!!

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

  1. #1

    Default FormsAuthentication Redirection NOT WORKING!!

    Thanks in advance to anyone who can help:)

    Ok- I've got two different ASP.NET projects communication with each other;
    one has its WEB.CONFIG file restricting anonymous users with the following
    entry:
    <authentication mode="Forms">
    <forms loginUrl="OtherASPNETprojectname/login.aspx" name="whateverIwant"
    path="/" protection="All" />
    </authentication>
    <authorization>
    <deny users="?" />
    </authorization>

    The other project, which has the login.aspx page allows anonymous users and
    uses Windows authentication. The login.aspx contains event-driven logic to
    create the Authentication cookie:
    FormsAuthentication.SetAuthCookie(txtUser.Text.Tri m(),true);
    Which it does so successfully **(however, the cookie is not named
    "whateverIwant", as I specified in the web.config file in the first project,
    but makes its own default name.**
    It then gets the redirection URL with the formsauthentication.getRedirectUrl
    method,
    which it also does succesfully. The final line of code simply does a
    Response.Redirect(redirectionurl);
    to send it to the protected page with its cookie authentication;

    WHAT'S DRIVING ME CRAZY IS THAT IT SIMPLY REFRESHES LOGIN.ASPX!!!!! IT
    DOESN'T GO ANYWHERE!! I'VE REMOVED ANY ROUTER/FIREWALL HARDWARE/SOFTWARE AND
    GAVE IT A DIRECTION CONNECTION TO THE INTERNET!! It does everything it
    supposed to (acknowledging the correct username and password, creating the
    cookie (albeit not in the name I specified), and produces the correct
    redirection URL; IT JUST DOESN'T REDIRECT!!! IT HAS TO BE SOMETHING WITH
    READING THE COOKIE ITSELF, OR I DON'T KNOW!!
    **My servername also does not have any "_" characters in it, just plain text
    letters**
    studen77 Guest

  2. Similar Questions and Discussions

    1. FormsAuthentication.SignOut not working
      Hello This SignOut code is not working, any ideas? TIA. public class logout : System.Web.UI.Page { private void Page_Load(object sender,...
    2. FormsAuthentication and Redirection fails
      Hi, I am using FormsAuthentication in VS.NET 2003, but for some reason the authentication code does not seem to be behaving as expected. The...
    3. FormsAuthentication.SignOut() not working.
      In my search to understand ASP.NET security, I went to www.asp.net and was looking at their beginner source code. Here is the link to the code that I...
    4. formsAuthentication.Signout() not working ?? ANYONE KNOW THE ANSWER
      I am using forms authentication in my apps. Every page I added: Me.Response.Expires = 0 Me.Response.Cache.SetCacheability...
    5. formsauthentication.signout not working too good
      how do i not let the user go back after he/she signs out of my web app? i'm using formsauthentication.signout with cookies but the user is still...
  3. #2

    Default Re: FormsAuthentication Redirection NOT WORKING!!

    Not sure if I understand 100% but the 2 sites will effectively be
    incompatible in terms of the authentication being used. If the cookies are
    named differently, OR the site is on a different hostname, then they wont be
    able to see each others auth cookie and no auth will occur. Have a look at
    my article at [url]http://aspalliance.com/553[/url] which may help.

    --

    - Paul Glavich
    ASP.NET MVP
    ASPInsider ([url]www.aspinsiders.com[/url])


    "studen77" <studen77@discussions.microsoft.com> wrote in message
    news:5EBFBF3D-C764-408E-A7F6-1C280E829D03@microsoft.com...
    > Thanks in advance to anyone who can help:)
    >
    > Ok- I've got two different ASP.NET projects communication with each other;
    > one has its WEB.CONFIG file restricting anonymous users with the following
    > entry:
    > <authentication mode="Forms">
    > <forms loginUrl="OtherASPNETprojectname/login.aspx"
    name="whateverIwant"
    > path="/" protection="All" />
    > </authentication>
    > <authorization>
    > <deny users="?" />
    > </authorization>
    >
    > The other project, which has the login.aspx page allows anonymous users
    and
    > uses Windows authentication. The login.aspx contains event-driven logic to
    > create the Authentication cookie:
    > FormsAuthentication.SetAuthCookie(txtUser.Text.Tri m(),true);
    > Which it does so successfully **(however, the cookie is not named
    > "whateverIwant", as I specified in the web.config file in the first
    project,
    > but makes its own default name.**
    > It then gets the redirection URL with the
    formsauthentication.getRedirectUrl
    > method,
    > which it also does succesfully. The final line of code simply does a
    > Response.Redirect(redirectionurl);
    > to send it to the protected page with its cookie authentication;
    >
    > WHAT'S DRIVING ME CRAZY IS THAT IT SIMPLY REFRESHES LOGIN.ASPX!!!!! IT
    > DOESN'T GO ANYWHERE!! I'VE REMOVED ANY ROUTER/FIREWALL HARDWARE/SOFTWARE
    AND
    > GAVE IT A DIRECTION CONNECTION TO THE INTERNET!! It does everything it
    > supposed to (acknowledging the correct username and password, creating the
    > cookie (albeit not in the name I specified), and produces the correct
    > redirection URL; IT JUST DOESN'T REDIRECT!!! IT HAS TO BE SOMETHING WITH
    > READING THE COOKIE ITSELF, OR I DON'T KNOW!!
    > **My servername also does not have any "_" characters in it, just plain
    text
    > letters**

    Paul Glavich [MVP ASP.NET] Guest

  4. #3

    Default Re: FormsAuthentication Redirection NOT WORKING!!

    Check to see if you have smart navigation turned on for the login page. I had the same problem and turning this off seems to have solved it.

    --
    Message posted via [url]http://www.dotnetmonster.com[/url]
    rob kelly via DotNetMonster.com 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