Context.User across sites

B

Ben Waldron

I have a website (ASP.NET 1.0) that is attaching a Principle to Context.User
(and checking autnetication in the Authenticate_Request event.

I am planning on deploying another site (ASP.NET 2.0) and want respect the
authentication from the first site. Is it possible to do this? I would
assume that I would lose the Context across site boundaries, but wanted to
check to make sure.

If I can't do this, what is the path of least resistance to unify
authentication across these sites (Windows authentication is not an option)?

Thanks in advance,
Ben
 
D

Dominick Baier [DevelopMentor]

Hello Ben,

ok - i am not 100% sure if the FormsAuth cookies are compatible between 1.0
and 2.0, but

- you have to get that cookie accross to you "other" site (easy if in the
same domain namespace) - or in other words, the browser has to send the cookie
to both sites
- if both apps use the same key for cookie decryption/validation this should
just work seamlessly.

generate a <machineKey> element, duplicate this setting in both apps.

here is a tool to generate the key xml element:
http://www.develop.com/technology/resourcedetail.aspx?id=78da5ca5-5079-4f8f-99c5-b080117ceac0
 
D

Dominick Baier [DevelopMentor]

Hello Ben,

btw - using ASP.NET 2.0 there is a more elegant way of getting the groups
from a windows user than described in the article

simply:

string[] roles = new WindowsTokenRoleProvider().GetRolesForUser(Context.User.Identity.Name);
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,008
Latest member
HaroldDark

Latest Threads

Top