Feedback
Did this article resolve your question/issue?

   

Article

Custom Owin is not working after upgrade to Sitefinity 10

« Go Back

Information

 
TitleCustom Owin is not working after upgrade to Sitefinity 10
URL Namecustom-owin-is-not-working-after-upgrade-to-sitefinity-10
Article Number000133369
EnvironmentProduct: Sitefinity
Version: 10.x, 11.x
OS: All supported OS versions
Database: All supported Microsoft SQL Server versions
Question/Problem Description
After upgrading to Sitefinity 10, using Owin for customized solutions is no longer working.

Using the following line the in the web.config causes error with the authentication:
<add key="owin:appStartup" value="MyStartupConfig" />
Steps to Reproduce
Clarifying Information
Error Message
Defect Number
Enhancement Number
Cause
Resolution

For Sitefinity 10.2 and above

Official support for plugging-in custom components in the OWIN pipeline is added.

1. Add the following key in the web.config file
 
<add key="owin:appStartup" value="SitefinityWebApp.Startup" />
2. Implement the custom Startup class
using Owin;
using Telerik.Sitefinity.Owin;
 
namespace SitefinityWebApp
{
    public class Startup
    {
        public void Configuration(IAppBuilder app)
        {
            // Register default Sitefinity middlewares in the pipeline
            app.UseSitefinityMiddleware();
            
            // Add custom middlewares app.MapSignalR(); for example 
        }
    }
}
 

For Sitefinity 10.0 to 10.1 inclusive

In order to use OWIN, the configuration class needs to inherit the SitefinityOwinStartup and override the Configuration method.
The Configuration method requires that base.Configuration(app) be called before any custom code.

1. Add the following key in the web.config file
 
<add key="owin:appStartup" value="SitefinityWebApp.MyStartup" />

2. Implement the MyStartup class
using Owin;
using Telerik.Sitefinity.Authentication;

namespace SitefinityWebApp
{
    public class MyStartup : SitefinityOwinStartup
    {
        public override void Configuration(IAppBuilder app)
        {
            base.Configuration(app);

            //TODO: Add custom logic
        }
    }
}

NOTE: The above implementation is not fully tested and can lead to issues with the authentication. Make sure to test it extensively before using it in Production environments.
 
Workaround
Notes
Last Modified Date12/26/2018 2:49 PM
Attachment 
Files
Disclaimer The origins of the information on this site may be internal or external to Progress Software Corporation (“Progress”). Progress Software Corporation makes all reasonable efforts to verify this information. However, the information provided is for your information only. Progress Software Corporation makes no explicit or implied claims to the validity of this information.

Any sample code provided on this site is not supported under any Progress support program or service. The sample code is provided on an "AS IS" basis. Progress makes no warranties, express or implied, and disclaims all implied warranties including, without limitation, the implied warranties of merchantability or of fitness for a particular purpose. The entire risk arising out of the use or performance of the sample code is borne by the user. In no event shall Progress, its employees, or anyone else involved in the creation, production, or delivery of the code be liable for any damages whatsoever (including, without limitation, damages for loss of business profits, business interruption, loss of business information, or other pecuniary loss) arising out of the use of or inability to use the sample code, even if Progress has been advised of the possibility of such damages.