Integrate Windows Identity Foundation into Composite C1
Composite.Community.WindowsIdentityFoundation is a small package that demonstrates integration of Composite C1 with Windows Identity Foundation (WIF). With this package you can add to a C1 website a login form, allowing visitors to log in to the website with Windows Live ID or a Google account via AppFabric's Access Control Service that supports WIF.
For more information please refer to:
Prerequisites
To use the package you are supposed to ensure a number of prerequisites.
- Composite C1 website v2.1.1 or later
- Visual studio 2010. (With the current setup it would much easier to have the website and Visual Studio on the same machine so that its plugin could create security certificates and etc.)
- Windows Identity Foundation
- Windows Identity Foundation SDK
- An account at live.com (an MSN messenger account.)
- The Composite.Community.WindowsIdentityFoundation package
Before you install and use the Composite.Community.WIF package, please complete these steps:
- Install Windows Identity Foundation and restart the computer.
- Install Windows Identity Foundation SDK .
- Log in to https://portal.appfabriclabs.com/ with yor Windows Live ID, and complete the steps as described in Registering at AppFabric.
Now add the STS certificate to your website:
- Open your website in Visual Studio 2010. (Please do not use the network drive. The site should be on the same machine as VS2010 so it can add security certificates.)
- Right-click the website folder and click "Add STS reference".
- In the Welcome page of the wizard, supply the path to your website's web.config, and URL at which the website is available.
- In the Security Token Service page, select "Use an existing STS".
- Get the URL to "WS-Federation Metadata" (as described in Registering at AppFabric) and paste it here.
If you open the website in a browser at this point, you should redirect you to a login page. If not, please make sure you have followed the steps above as required.
Now allow anonymous logins:
- Edit web.config of your website
- Locate the element: <configuration/system.web/authorization>
- Comment out the element <deny/>:
<system.web> <authorization> <!--deny users="?" /--> </authorization> </system.web>
Implementing Composite.Community.WIF
- Install the Composite.Community.WIF package.
- Insert the Composite.Community.WIF.LoginForm function to your layout template or add the following code:
<f:function xmlns:f="http://www.composite.net/ns/function/1.0" name="Composite.Community.WIF.LoginForm" />
Important Notes
- In the current LiveID implementation, the username and email address are not available.
Requirements
Composite C1 version 2.1.1 or later