Does anyone know how to integrate an OWIN component as a plugin?
I am working on a project that uses Azure Active Directory authentication through OAuth/OpenID Connect for login. It would be pretty simple to just use the OpenID Connect OWIN components, but I can't figure how to register the OWIN components from within the plugin.
I'd prefer not to modify any of the nopCommerce source--can this be done through a plugin only?
1. Have a Startup class in your plugin. Have a Configuration method that will be called by the Owin Host to allow you to add your Owin Middlewares.
2. Enable the OwinAutomaticAppStartup setting in the Web.config. The setting is already present in the Web.config and you just need to change its value from False to True.
This way you can register your Owin components in your plugin's StartUp class Configuration method.
You can read more here: http://www.asp.net/aspnet/overview/owin-and-katana/owin-startup-class-detection
Thanks everyone for your help so far. I upgraded to 3.70 and can confirm that the the OWIN startup is registered and run.
My problem though is it isn't triggering the external (Azure AD) login form. I have nop configured to not allow browsing without being logged-in, but I only get the standard nop login form, not the Azure AD form hosed by Microsoft.
I have a test application the runs the same code and I get the Azure AD form as expected. What do I need to do so nopCommerce will trigger the external login form?
I figured out my problem. I had to remove the forms authentication setting from the web.config and all works fine now. Thanks to everyone for your help.