Last post Mar 20, 2017 09:19 PM by kmcnet
Mar 19, 2017 12:24 AM|kmcnet|LINK
Hello everyone and thanks for your help in advance. I have a few old webform projects that use forms authentication as security and am interested in transitioning to the identity framework, but need a better understanding before proceedings . I've read
a few articles on getting started such as
https://docs.microsoft.com/en-us/aspnet/identity/overview/getting-started/adding-aspnet-identity-to-an-empty-or-existing-web-forms-project but need to understand a few details. The example for webforms shows the need to change the startup file to:
public class Startup
public void Configuration(IAppBuilder app)
// For more information on how to configure your application, visit http://go.microsoft.com/fwlink/?LinkID=316888
AuthenticationType = DefaultAuthenticationTypes.ApplicationCookie,
LoginPath = new PathString("/Login")
Is this only for webforms, or is the same changes needed for MVC or WebApi? Second, lets say I wanted certain pages to require login, but maybe other pages to be available without authentication. If I understand correctly, under this startup configuration,
no page will be available without login. How do I accomplish the public/private blend I outlined above? Any help would be appreciated.
Mar 20, 2017 10:03 AM|Cathy Zou|LINK
Is this only for webforms, or is the same changes needed for MVC or WebApi?
the purpose of the code you posted is to initialize the OWIN identity components.
The UseCookieAuthentication extension tells the ASP.NET Identity framework to use cookie based authentication. We need to set 2 properties:
So, I think that it is the same changes needed for MVC or WebApi.
How do I accomplish the public/private blend I outlined above? Any help would be appreciated.
Mar 20, 2017 09:19 PM|kmcnet|LINK
Thanks for the great explanation and references. This is just what I needed. I appreciate it.