Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Security > Single signon (with FormsAuth) for mutliple web apps

Reply
Thread Tools

Single signon (with FormsAuth) for mutliple web apps

 
 
Brad
Guest
Posts: n/a
 
      09-24-2003
I'm working on single signon for multiple web apps on a single domain. If I
authenticate in wepApp1 then I am authenticated in webApp2 however, anywhere
in the global.asax code of webApp2 the following don't seem to be
set/initialized:
Request.IsAuthenticated
User.Identity
The authentication cookie is available in webApp2's global.asax and once
a form is loaded (i.e. I'm on a pageload event) the values of
Request.IsAuthenticated and User.Identity are available.

So why would the values of user identity and IsAuthenticated not be
avaialble in the global.asax of webApp2?


Thanks


Brad



 
Reply With Quote
 
 
 
 
Chris Jackson
Guest
Posts: n/a
 
      09-25-2003
In terms of your code, both of your assemblies (one for each we application)
are completely separate. One assembly doesn't get to read from the other,
even though they are in the same App Domain. The ability to read the cookie
by both essentially serves as the cross-assembly communication mechanism
(visualize it as serving a similar function to named pipes); others are
available, but this is probably the easiest.

One solution I have implemented is to create a custom logon page that looks
for a cookie that indicates authentication. If I find a valid cookie, then I
go ahead and set up that user as authenticated and return to the page that
requested the authentication. If I don't, then I display the page as normal
and have them enter their user/pass.

--
Chris Jackson
Software Engineer
Microsoft MVP - Windows XP
Windows XP Associate Expert
--
"Brad" <> wrote in message
news:%...
> I'm working on single signon for multiple web apps on a single domain. If

I
> authenticate in wepApp1 then I am authenticated in webApp2 however,

anywhere
> in the global.asax code of webApp2 the following don't seem to be
> set/initialized:
> Request.IsAuthenticated
> User.Identity
> The authentication cookie is available in webApp2's global.asax and

once
> a form is loaded (i.e. I'm on a pageload event) the values of
> Request.IsAuthenticated and User.Identity are available.
>
> So why would the values of user identity and IsAuthenticated not be
> avaialble in the global.asax of webApp2?
>
>
> Thanks
>
>
> Brad
>
>
>



 
Reply With Quote
 
 
 
 
Brad
Guest
Posts: n/a
 
      09-26-2003
I found the problem....basicaly a brain lapse on my part after being away
from hands-on coding for a few months.
I can access the authentication info just fine but I need to do it in
Application_AuthenticateRequest. Once I did that then everything works as I
expected: Identity is avaialble and IsAuthenticated is true is the user is
logged in.
Brad


"Chris Jackson" <> wrote in message
news:...
> In terms of your code, both of your assemblies (one for each we

application)
> are completely separate. One assembly doesn't get to read from the other,
> even though they are in the same App Domain. The ability to read the

cookie
> by both essentially serves as the cross-assembly communication mechanism
> (visualize it as serving a similar function to named pipes); others are
> available, but this is probably the easiest.
>
> One solution I have implemented is to create a custom logon page that

looks
> for a cookie that indicates authentication. If I find a valid cookie, then

I
> go ahead and set up that user as authenticated and return to the page that
> requested the authentication. If I don't, then I display the page as

normal
> and have them enter their user/pass.
>
> --
> Chris Jackson
> Software Engineer
> Microsoft MVP - Windows XP
> Windows XP Associate Expert
> --
> "Brad" <> wrote in message
> news:%...
> > I'm working on single signon for multiple web apps on a single domain.

If
> I
> > authenticate in wepApp1 then I am authenticated in webApp2 however,

> anywhere
> > in the global.asax code of webApp2 the following don't seem to be
> > set/initialized:
> > Request.IsAuthenticated
> > User.Identity
> > The authentication cookie is available in webApp2's global.asax and

> once
> > a form is loaded (i.e. I'm on a pageload event) the values of
> > Request.IsAuthenticated and User.Identity are available.
> >
> > So why would the values of user identity and IsAuthenticated not be
> > avaialble in the global.asax of webApp2?
> >
> >
> > Thanks
> >
> >
> > Brad
> >
> >
> >

>
>



 
Reply With Quote
 
Jacob Yang [MSFT]
Guest
Posts: n/a
 
      09-26-2003
Hi Brad,

I am glad to know that the problem is resolved.

Thank you very much for sharing your solution. It is helpful to everybody
here.

Best regards,

Jacob Yang
Microsoft Online Partner Support
Get Secure! ¨C www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

 
Reply With Quote
 
 
 
Reply

Thread Tools

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
resolve single line with multiple items into mutliple lines, single items ela Perl Misc 12 04-06-2009 06:47 PM
EIM single-signon Kerberos service ticket could not be retreived. polilop Java 2 05-03-2008 05:49 PM
Implementing Single-Signon in Window Services ginkim@gmail.com ASP .Net 0 02-13-2007 09:04 PM
how to single signon two .net 2.0 websites? =?Utf-8?B?UG9ueSBUc3Vp?= ASP .Net 1 04-12-2006 08:56 AM
Single external signon with Integrated Auth apps and regular webs Phillip Jubb ASP .Net Security 1 12-13-2004 11:08 AM



Advertisments