Ask a Question related to ASP.NET Security, Design and Development.
-
studen77 #1
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
-
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,... -
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... -
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... -
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... -
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... -
Paul Glavich [MVP ASP.NET] #2
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...name="whateverIwant"> 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"and> path="/" protection="All" />
> </authentication>
> <authorization>
> <deny users="?" />
> </authorization>
>
> The other project, which has the login.aspx page allows anonymous usersproject,> 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 firstformsauthentication.getRedirectUrl> but makes its own default name.**
> It then gets the redirection URL with theAND> 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> GAVE IT A DIRECTION CONNECTION TO THE INTERNET!! It does everything it
> supposed to (acknowledging the correct username and password, creating thetext> 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> letters**
Paul Glavich [MVP ASP.NET] Guest
-
rob kelly via DotNetMonster.com #3
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



Reply With Quote

