Sitefinity Identity Provider Sample

This KB shows how to write custom Identity Providers to TeamPulse with Sitefinity as an example.

Step1: Identity Provider Handler

The first thing to do is to copy the dlls from the attached sample project inside TeamPulse [program files]\Telerik\TeamPulse\wwwroot\ folder.

Step2: Configure TeamPulse identity providers

 Add to the [program_files]\Telerik\TeamPulse\wwwroot\App_Data\Telerik\Configuration\SecurityConfig.config new identity provider.

<add name="Sitefinity"
   clientId="http://ydimitrov:9898"
   clientSecret=""
   scope=""
   identityProviderHandler="SitefinityIdentityProvider.SitefinityIdentityProviderHandler, SitefinityIdentityProvider"
   loginUrl="http://localhost/sitefinity/Sitefinity/Authenticate/SWT"
   imageUrl="http://www.telerik.com/assets/img/sitenav/telerik-logo.gif" />

 Add the new provider into TeamPulse relying parties section.

<relyingParties>
    <add clientId="uri:TeamPulse" signInFormUrl="../Authentication" 
    clientSecret="C45D76DF431DE3D19FEE580EA" 
    symmetricKey="80D93D5C800FFFBB4A286E21DDA85B62D6718F9A5890B1210AEBA4489690FCD5">
        <replyUris>
            <add uri="http://YDIMITROV:9898"/>
            <add uri="http://localhost:9898"/>
        </replyUris>
        <identityProviders>
            <add name="TeamPulse"/>
            <add name="Windows"/>
            <add name="Sitefinity"/>
        </identityProviders>
    </add>   
</relyingParties>

Step 3: Configure Sitefinity

Add to the Sitefinity SecurictyConfig.config located in [sitefinity_site]\App_Data\Sitefinity\Configuration\SecurityConfig.config TeamPulse as relying party.

It is important that the realm and the clientId from the TeamPulse config match.

<relyingParties>
    <add key="84B4B7D46EEF8C73350F18FCDE5FAC1666486E7818CA0072DD2366F2E8746312" 
        encoding="Hexadecimal" 
        realm="http://localhost" />
    <add key="84B4B7D46EEF8C73350F18FCDE5FAC1666486E7818CA0072DD2366F2E8746312" 
        encoding="Hexadecimal" 
        realm="http://ydimitrov:9898" />
</relyingParties>

 Step 4: Additional Customizations

You can extend the Sitefinity provider and through the Sitefinity API to get the FirstName, LastName and email when the authentication request is handled into the provider.

Also you can do additional enhancement and automatically create the user if his user name is unique. You can do that if you add the following option in the config file under appSettings

<appSettings>
    <add key="HideCompleteRegistrationForm" value="true" />
</appSettings>
Files