HighTechTalks DotNet Forums  

Issue using ASP.NET forms authenticationwith frame redirect

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


Discuss Issue using ASP.NET forms authenticationwith frame redirect in the ASP.net Security forum.



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

Default Issue using ASP.NET forms authenticationwith frame redirect - 12-09-2007 , 01:37 PM






I am facing an issue using ASP.NET forms authentication.

Scenario:
Machine 1: http://subd1.provider1.com (1)
Frame redirect to http://subd.provider2.com
Machine 2: http://subd2.provider2.com (2)

For both URLs, I am getting the login page.
For (2), I could successfully login and the DestinationPageUrl is displayed
right after.
The problem is that for (1) after login the login page is displayed again
instead of the DestinationPageUrl.

I assume it has something to do with the frame redirect.

If I first go to (2) and successfully login and later go to (1), it tells me
I am already logged in and things work fine.

I have already try to use session state mode 'StateServer' with no success.


Any help would be greatly appreciated!
Dieter


Reply With Quote
  #2  
Old   
Walter Wang [MSFT]
 
Posts: n/a

Default RE: Issue using ASP.NET forms authenticationwith frame redirect - 12-10-2007 , 01:53 AM






Hi Dieter,

I'm not very clear about your current configuration now, so I need to ask
for some information first:

1) Are you trying to achieve Single-Sign-On between different website
domain? Usually the forms authentication cookie (if cookie is enabled) can
be shared by domains subd1.domain.com and subd2.domain.com, but not between
subd.domain1.com and subd.domain2.com.
2) Do you mean that a page in the frameset is redirected to
http://subd.provider2.com and you will be presented two login pages? Is the
first login page also from domain provider2.com?
3) Are you encrypting forms authentication ticket? If this is the case, you
will need to make sure the machine key used between two websites are the
same, they're auto-generated by default.

Please see if following pages help:

#Single Sign On across multiple ASP.NET applications > Developer's Corner -
Resources for Developers > Knowledge Base
http://www.developer-corner.com/Reso...118/articleTyp
e/ArticleView/articleId/23/Default.aspx


#Hosting Multiple Web Applications
http://msdn2.microsoft.com/en-us/library/aa302436.aspx


Regards,
Walter Wang (wawang (AT) online (DOT) microsoft.com, remove 'online.')
Microsoft Online Community Support

==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.


Reply With Quote
  #3  
Old   
Walter Wang [MSFT]
 
Posts: n/a

Default RE: Issue using ASP.NET forms authenticationwith frame redirect - 12-11-2007 , 03:29 AM



Hi Dieter,

Thanks for your detailed explanation. Now I have clearer picture of the
issue.

I believe this is because IE by default rejects cookies from a frame and
ASP.NET Forms Authentication needs the cookie to be accepted at client-side
to be considered as "logged in".

Here's some explanation and possible workarounds:

#ASP.NET Resources - Frames, ASPX Pages and Rejected Cookies
http://aspnetresources.com/blog/fram...d_cookies.aspx

I think the simplest workaround will be to prevent your login page from
putting in a frameset by using javascript below:

<script type="text/javascript">
if (top != self)
top.location.href = location.href;
</script>


Regards,
Walter Wang (wawang (AT) online (DOT) microsoft.com, remove 'online.')
Microsoft Online Community Support

==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.


Reply With Quote
  #4  
Old   
dpomt
 
Posts: n/a

Default RE: Issue using ASP.NET forms authenticationwith frame redirect - 12-12-2007 , 04:50 PM



Walter,

thanks a lot for your explanation. This makes sense and I now do understand
why the frame redirect does not work for me with ASP.NET authentication.

Quote:
I think the simplest workaround will be to prevent your login page from
putting in a frameset by using javascript below:
...
This is no option for me since the only reason I am using frame redirect is
to see domain1 in the browser address bar instead of domain2.

I guess the only possibility for me will be to move the domain1 to the
provider that also hosts domain2.

Thanks again and best regards
Dieter

""Walter Wang [MSFT]"" wrote:

Quote:
Hi Dieter,

Thanks for your detailed explanation. Now I have clearer picture of the
issue.

I believe this is because IE by default rejects cookies from a frame and
ASP.NET Forms Authentication needs the cookie to be accepted at client-side
to be considered as "logged in".

Here's some explanation and possible workarounds:

#ASP.NET Resources - Frames, ASPX Pages and Rejected Cookies
http://aspnetresources.com/blog/fram...d_cookies.aspx

I think the simplest workaround will be to prevent your login page from
putting in a frameset by using javascript below:

script type="text/javascript"
if (top != self)
top.location.href = location.href;
/script


Regards,
Walter Wang (wawang (AT) online (DOT) microsoft.com, remove 'online.')
Microsoft Online Community Support

==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.



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 - 2008, Jelsoft Enterprises Ltd.