A Precarious Balance

Sean Winstead's web site & blog
Welcome to A Precarious Balance Sign in | Join | Help
in Search

A Precarious Balance

Sean Winstead's web site & blog

Community Server: Single-Sign-On in reverse

Community Server's Single-Sign-On modules handle the case where:

  • You have an ASP.NET website with an adjoining Community Server website
  • Members log into your main ASP.NET website and you want Community Server to recognize that site's authentication of the member

What if members log into your Community Server website but not your main ASP.NET website? Over the past week, I've encountered two people who want membership to be handled by Community Server. But their main website needs to determine whether the member is authenticated via User.Identity.IsAuthenticated and User.Identity.Name.

It's possible to do so. I tested the scenario where the main website is at www.yourdomain.com and the community is at community.yourdomain.com. Both sites use forms authentication.

In order for www.yourdomain.com to see the authenticated user, you must make sure that two elements within the web.config file of each website are compatible.

In the <forms> element of the <authentication> element, the protection attributes must have identical values and the path attributes must have compatible values. In the <machineKey> element, the validationKey, decryptionKey, and validation attributes must have identical values. The following example shows the elements:

<authentication mode="Forms">
 <
forms name=".CommunityServerpath="/" protection="Alltimeout="60000"
    loginUrl="CS login Url" slidingExpiration="true" />
</
authentication>

<machineKey
  validationKey = " [your validation key]"
  decryptionKey = " [your decryption key]"
  validation = " SHA1" />

This is described with a little more detail in the .NET Framework Developer's Guide, topic Forms Authentication Across Applications.

Published Monday, March 26, 2007 7:00 AM by Sean Winstead

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Comments

 

Dave Burke's Community Server Bits said:

Sean Winstead walks us through the process of employing Community Server Single Sign-On in reverse. That

March 28, 2007 3:03 AM

Leave a Comment

(required) 
(optional)
(required) 
Submit