I am using asp.net 5 and Identity 3 to authenticate users but it always redirect to the default login url which is "Account/Login". I want to change it but there does not seem to be anywhere to set this options. I use AddIdentity() in Configure() method. Please help. Thanks
Using .Net Core 1.0.0 + Identity + Facebook OAuth, the accepted answer no longer compiles. This is what worked:
public void ConfigureServices(IServiceCollection services)
{
(...)
services.Configure<IdentityOptions>(options =>
{
options.Cookies.ApplicationCookie.LoginPath = new PathString("/Login");
options.Cookies.ApplicationCookie.LogoutPath = new PathString("/Logoff");
});
}
app.UseCookieAuthentication(options =>
{
options.LoginPath = new PathString("/Admin/Login");
options.LogoutPath = new PathString("/Admin/LogOff");
},
IdentityOptions.ApplicationCookieAuthenticationScheme
);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With