Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Safe to remove all OWIN packages from MVC5 project with Simple Membership?

I'd like to clean up the project I'm working on. We are using Simple Membership and have no intention of supporting authentication using Twitter, Google, etc. I don't know that much about OWIN but I see quite a few NuGet packages installed by default.

Is it safe to uninstall all of the OWIN packages?

like image 609
rwkiii Avatar asked Jun 18 '14 04:06

rwkiii


People also ask

How do I remove OWIN from my project?

To disable OWIN startup discovery add the appSetting owin:AutomaticAppStartup with a value of "false" in the web. config file.

Why use OWIN authentication?

OWIN provides the underlying set of components to asp.net applications to enable, then to be flexible,portable,and lightweight. A better performance and optimization with asp.net applications is an added advantage. It (OWIN) can also secure apps hosted on IIS, including asp.net MVC as well as Web API and Web Forms.

Why we use OWIN in MVC?

The main goal of the OWIN interface is to decouple the server and the applications. It acts as middleware. ASP.NET MVC, ASP.NET applications using middleware can interoperate with OWIN-based applications, servers, and middleware. It helps develop different types of authentication methods.

How does OWIN authentication work?

After the user provides credentials, your application code will validate the user name and password and build user claims including user's name, roles, etc. After passing claims to the Forms authentication middleware, it will convert it to an application ticket and serialize, encrypt and encode it into a ticket token.


2 Answers

You can safely delete all Owin packages and you don't have add owin:AutomaticAppStartup key with false value.

Just make sure you delete all owin dlls from your bin folders after removing owin packages. They are not cleaned from your bin folder by Visual Studio and somehow they get executed automatically. See my answer in this question:

c# - OWIN Startup Class Missing - Stack Overflow

like image 184
Hüseyin Yağlı Avatar answered Oct 16 '22 17:10

Hüseyin Yağlı


I also just had to do this. One of our team had created the MVC 5 website, which included all the OWIN stuff. We're using Membership and so after doing a little digging into the differences (and honestly looking like it would NOT be easy), I just decided to dive head first. Here's what I did:

  1. Deleted Startup.cs (this will give an error that's fixed by the next step)
  2. Add the following key & value to appSettings in your config: <add key="owin:AutomaticAppStartup" value="false"/>
like image 18
DenverDev Avatar answered Oct 16 '22 16:10

DenverDev