Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   ASP .Net Security (http://www.velocityreviews.com/forums/f62-asp-net-security.html)
-   -   FormsAuthentication Redirection NOT WORKING!! (http://www.velocityreviews.com/forums/t766991-formsauthentication-redirection-not-working.html)

studen77 01-01-2005 04:55 AM

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**

Paul Glavich [MVP ASP.NET] 01-02-2005 07:11 AM

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 http://aspalliance.com/553 which may help.

--

- Paul Glavich
ASP.NET MVP
ASPInsider (www.aspinsiders.com)


"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**





All times are GMT. The time now is 06:41 PM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.