Switch from forms to claims-based SWT authentication

NEW TO SITEFINITY?

If you are upgrading your project from Sitefinity CMS 4.x version to Sitefinity CMS 5.x or above, claims-based authentication will not be applied automatically. To configure your site to use claims-based authentication, perform the following:

  1. Login to the backend of your website.
  2. Click Administration » Settings » User Authentication.
  3. In the dropdown box, select Claims based authentication and click Save changes.
  4. Open the web.config file of your project and perform the following transformations:
    <!-- Under <configSections>, add the following section: -->
    <section name="system.identityModel" type="System.IdentityModel.Configuration.SystemIdentityModelSection, System.IdentityModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
    <section name="system.identityModel.services" type="System.IdentityModel.Services.Configuration.SystemIdentityModelServicesSection, System.IdentityModel.Services, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
    <!-- Under <system.web>, add the following section: -->
    <httpRuntime requestValidationType="Telerik.Sitefinity.Security.Claims.CustomRequestValidator, Telerik.Sitefinity" />
    <!-- Find and set authentication mode to None in the following way: -->
    <authentication mode="None" />
    <!--Inside section <configuration> / <appSettings>, add the following:-->
    <add key="aspnet:UseTaskFriendlySynchronizationContext" value="true" />
    <!-- Under <configuration> section, add the system.identityModel section before the closing tag in the following way: -->
    <system.identityModel>
    <identityConfiguration>
    <securityTokenHandlers>
    <add type="Telerik.Sitefinity.Security.Claims.SWT.SWTSecurityTokenHandler, Telerik.Sitefinity" />
    </securityTokenHandlers>
    <audienceUris mode="Never" />
    <issuerNameRegistry type="Telerik.Sitefinity.Security.Claims.CustomIssuerNameRegistry, Telerik.Sitefinity">
    <trustedIssuers />
    </issuerNameRegistry>
    <issuerTokenResolver type="Telerik.Sitefinity.Security.Claims.SWT.WrapIssuerTokenResolver, Telerik.Sitefinity" />
    <certificateValidation certificateValidationMode="None" />
    </identityConfiguration>
    </system.identityModel>
    <system.identityModel.services>
    <federationConfiguration >
    <wsFederation passiveRedirectEnabled="true" issuer="http://localhost" realm="http://localhost" requireHttps="false" />
    <cookieHandler requireSsl="false" />
    </federationConfiguration>
    </system.identityModel.services>
    <!-- Under the <httpModules> section, add the new modules required for Claims authentication, in the following oreder: -->
    <!-- If you are using IIS7+, add the modules to the <modules> section under <system.webserver>, rather than <httpModules>. -->
    <remove name="FormsAuthentication"/>
    <remove name="RoleManager"/>
    <add name="Sitefinity" type="Telerik.Sitefinity.Web.SitefinityHttpModuleIIS6, Telerik.Sitefinity" />
    <add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
    <add name="RadUploadModule" type="Telerik.Web.UI.RadUploadHttpModule, Telerik.Web.UI" />
    <add name="SitefinityAnalyticsModule" type="Telerik.Sitefinity.Analytics.Server.DependencyResolution.Module.DependencyRegistrarHttpModule, Telerik.Sitefinity.Analytics.Server.DependencyResolution" />
    <dependentAssembly>
    <assemblyIdentity name="Telerik.Sitefinity.Mvc" publicKeyToken="b28c218413bdf563" culture="neutral" />
    <bindingRedirect oldVersion="1.3.350.0" newVersion="1.4.360.0" />
    </dependentAssembly>
    <dependentAssembly>
    <assemblyIdentity name="System.IdentityModel.Tokens.Jwt" publicKeyToken="31bf3856ad364e35" culture="neutral" />
    <bindingRedirect oldVersion="0.0.0.0-4.0.20622.1351" newVersion="4.0.20622.1351" />
    </dependentAssembly>
    <dependentAssembly>
    <assemblyIdentity name="Microsoft.IdentityModel.Protocol.Extensions" publicKeyToken="31bf3856ad364e35" culture="neutral" />
    <bindingRedirect oldVersion="0.0.0.0-1.0.2.33" newVersion="1.0.2.33" />
    </dependentAssembly>
    <dependentAssembly>
    <assemblyIdentity name="System.Web.Http" publicKeyToken="31bf3856ad364e35" culture="neutral" />
    <bindingRedirect oldVersion="0.0.0.0-5.2.3.0" newVersion="5.2.3.0" />
    </dependentAssembly>
    <dependentAssembly>
    <assemblyIdentity name="System.Web.Cors" publicKeyToken="31bf3856ad364e35" culture="neutral" />
    <bindingRedirect oldVersion="0.0.0.0-5.2.3.0" newVersion="5.2.3.0" />
    </dependentAssembly>
    <dependentAssembly>
    <assemblyIdentity name="System.Net.Http.Formatting" publicKeyToken="31bf3856ad364e35" culture="neutral" />
    <bindingRedirect oldVersion="0.0.0.0-5.2.3.0" newVersion="5.2.3.0" />
    </dependentAssembly>
    <dependentAssembly>
    <assemblyIdentity name="Microsoft.Owin" publicKeyToken="31bf3856ad364e35" culture="neutral" />
    <bindingRedirect oldVersion="0.0.0.0-3.0.1.0" newVersion="3.0.1.0" />
    </dependentAssembly>
    <dependentAssembly>
    <assemblyIdentity name="Telerik.Windows.Documents.Flow" publicKeyToken="5803cfa389c90ce7" culture="neutral" />
    <bindingRedirect oldVersion="0.0.0.0-2015.1.225.40" newVersion="2015.1.225.40" />
    </dependentAssembly>
    <dependentAssembly>
    <assemblyIdentity name="Telerik.Windows.Documents.Core" publicKeyToken="5803cfa389c90ce7" culture="neutral" />
    <bindingRedirect oldVersion="0.0.0.0-2015.1.225.40" newVersion="2015.1.225.40" />
    </dependentAssembly>
    <dependentAssembly>
    <assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
    <bindingRedirect oldVersion="0.0.0.0-9.0.0.0" newVersion="9.0.0.0" />
    </dependentAssembly>
  5. Save and close the web.config file.
  6. Restart the application.

Want to learn more?

Increase your Sitefinity skills by signing up for our free trainings. Get Sitefinity-certified at Progress Education Community to boost your credentials.

Get started with Integration Hub | Sitefinity Cloud | Sitefinity SaaS

This free lesson teaches administrators, marketers, and other business professionals how to use the Integration hub service to create automated workflows between Sitefinity and other business systems.

Web Security for Sitefinity Administrators

This free lesson teaches administrators the basics about protecting yor Sitefinity instance and its sites from external threats. Configure HTTPS, SSL, allow lists for trusted sites, and cookie security, among others.

Foundations of Sitefinity ASP.NET Core Development

The free on-demand video course teaches developers how to use Sitefinity .NET Core and leverage its decoupled architecture and new way of coding against the platform.

Was this article helpful?