How to integrate the OauthExternalAuthentication project with your Sitefinity instance - Sitefinity/Sitefinity-External-STS-Integration GitHub Wiki

Home / How to integrate the OauthExternalAuthentication project with your Sitefinity instance


Note:
Due to a number of known issues, it's recommended to run the OauthExternalAuthentication project with Sitefinity under IIS and not under the integrated development server (Cassini).


Automatic package restoration

This project uses NuGet packages and supports automatic package restoration in order to automatically retrieve and add the required references at build time. To use automatic package restoration:

  1. Place the OauthExternalAuthentication folder (containing the OauthExternalAuthentication.csproj project) to the root of your sitefinity website. The folder should be a sibling to the SitefinityWebApp project file.

  2. Open your Sitefinity solution in Visual Studio.
    Add the OauthExternalAuthentication.csproj project to the solution.

  3. Make sure your compound solution with both projects is saved.

  4. Right-click the solution in Solution Explorer and click Enable NuGet Package Restore.

  5. The versions of Sitefinity references in the NuGet packages are listed in the packages.config file (additional version information can be found at the Releases page). If the version of Sitefinity in the restored packages does not match the Sitefinity version of your project, change references to the following assemblies from your website's bin folder:

  • Telerik.Sitefinity
  • Telerik.Sitefinity.Model
  • Telerik.Sitefinity.Utilities
  • Telerik.OpenAccess

Resolve packages on the SitefinityWebApp project

Some NuGet packages need to be manually restored and installed on the SitefinityWebApp project.

  1. Open the Package Manager Console window in Visual Studio, on the Tools menu, select Library Package Manager » Package Manager Console:

  2. On the Package Manager Console, switch to the SitefinityWebApp project on the Default project drop-down.

  3. Install the Microsoft.AspNet.Membership.OpenAuth package by typing the following command in the Package Manager Console:
    Install-Package Microsoft.AspNet.Membership.OpenAuth

  4. Install the DotNetOpenAuth.AspNet package by typing the following command in the Package Manager Console:
    Install-Package DotNetOpenAuth.AspNet

  5. Install the DotNetOpenAuth.GoogleOAuth2 package by typing the following command in the Package Manager Console:
    Install-Package DotNetOpenAuth.GoogleOAuth2

  6. Make sure your SitefinityWebApp project has a reference to Newtonsoft.Json. Particularly if you're running an upgraded project in which the reference has been removed as part of the upgrade procedure.
    To add the reference, on the Package Manager Console select the SitefinityWebApp project (similarly to the previous step) and insall the Newtonsoft.Json package by running the command:
    Install-Package Newtonsoft.Json

  7. Add a reference to the OauthExternalAuthentication to your SitefinityWebApp project and build the entire solution.

  8. On Sitefinity's backend and navigate to Administration » Modules & Services
    Modules and Services

  9. Click Install a module,
    Install a module

  10. Fill the form as shown below, and click Save:
    Name: OauthExternalAuthentication
    Type: OauthExternalAuthentication.OAuthAuthenticationModule, OauthExternalAuthentication

  11. The OAuthAuthenticationModule registers now a config section (OAEConfig) in its initialization process. This makes it easy to configure the provider's parameters.

In order to set a Facebook application and obtain a relevant ID and secret key, follow the instructions on the Setting Up The Authentication Integration with Facebook page.

Log into Sitefinity's backend with an administrator's account and navigate to Adminitration » Settings » Advanced. Scroll down the tree to OAE and fill the relevant parameters:

< Back home