HighTechTalks DotNet Forums  

FormsAuthentication problem with popup login window

ASP.net Security microsoft.public.dotnet.framework.aspnet.security


Discuss FormsAuthentication problem with popup login window in the ASP.net Security forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
Mark Farragher
 
Posts: n/a

Default FormsAuthentication problem with popup login window - 09-25-2003 , 01:22 PM






I have a problem with FormsAuthentication:

I have two web applications:
http://localhost/bx/authentication
http://localhost/myapp

I have a 'login' hyperlink in MyApp that opens
http://localhost/bx/authentication/login.aspx in a popup window. The popup
window has a username and password text field and an ok button. The postback
code for the ok button is:

....
FormsAuthenticationTicket ticket = new FormsAuthenticationTicket(
1, txtUID.Text, DateTime.Now, DateTime.Now.AddMinutes(30), false,
myPayload);
string ticketstring = FormsAuthentication.Encrypt(ticket);
HttpCookie cookie = new HttpCookie(FormsAuthentication.FormsCookieName,
ticketstring);
Response.Cookies.Add(cookie);
....

The web.config file in both applications has an authentication section:

....
<authentication mode="Forms">
<forms name="BXAuthentication" protection="All" />
</authentication>
....

This does not work. User.Identity is always null in MyApp. The weird thing
is that when I add this code to MyApp's Page_Load method:

Response.Write
(Request.Cookies[FormsAuthentication.FormsCookieName].Value.ToString());

I can actually see the serialized login ticket!! So the cookie is passed
correctly from the popup window to MyApp, but somehow this does not count as
being authenticated. How can I get MyApp to 'accept' the cookie? What am I
missing? Is authentication accross AppDomains possible at all?

Thanks for any help,

Mark



Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.