Ask a Question related to ASP.NET Security, Design and Development.
-
Mark Farragher #1
FormsAuthentication problem with popup login window
I have a problem with FormsAuthentication:
I have two web applications:
[url]http://localhost/bx/authentication[/url]
[url]http://localhost/myapp[/url]
I have a 'login' hyperlink in MyApp that opens
[url]http://localhost/bx/authentication/login.aspx[/url] 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
Mark Farragher Guest
-
Problems with access to an intranet through popup login window
Hi, The site is in two folders, the inside and the outside. To get to the inside you call a popup window containing the login.asp file. I f you try... -
Popup window with DataGrid focus problem
I have a main window with an editable DataGrid. When a user does double click in a cell a popup window opens that lets him select a value for the... -
Popup menu on popup window
Hi, I want to create a popup menu when a button on a popup window is clicked. I have this in my popup window: myMenu =... -
can a popup window return data to parent window?
Is it possible to do the following in php: I want to have a main form open. In the form I want a button that will open a popup window so the user... -
Removing NT popup login box
Here's what I'm trying to do: I have a web page that's calling the server variable LOGON_USER to retrieve the userid of the person accessing it. ... -
Mark Farragher #2
FormsAuthentication problem with popup login window
I have a problem with FormsAuthentication:
I have two web applications:
[url]http://localhost/bx/authentication[/url]
[url]http://localhost/myapp[/url]
I have a 'login' hyperlink in MyApp that opens
[url]http://localhost/bx/authentication/login.aspx[/url] 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
Mark Farragher Guest
-
Me2 #3
Re: FormsAuthentication problem with popup login window
Look here for information regarding authentication across applications:
[url]http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpconaspnetauthentication.asp[/url]
--
Ralph Page MBA, CMBA, MCDBA, MCSE, CCNA
-------------------------------------------------------------------------
"However beautiful the strategy, you should occasionally look at the
results."
-- Winston Churchill
-------------------------------------------------------------------------
"Mark Farragher" <mark@4castconsulting.com> wrote in message
news:#JFa1H5gDHA.3104@TK2MSFTNGP11.phx.gbl...postback> I have a problem with FormsAuthentication:
>
> I have two web applications:
> [url]http://localhost/bx/authentication[/url]
> [url]http://localhost/myapp[/url]
>
> I have a 'login' hyperlink in MyApp that opens
> [url]http://localhost/bx/authentication/login.aspx[/url] in a popup window. The popup
> window has a username and password text field and an ok button. TheHttpCookie(FormsAuthentication.FormsCookieName,> 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 = newas> 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> 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
>
>
Me2 Guest



Reply With Quote

