asp.net-core – 如何在使用asp.net 5时更改登录URL

前端之家收集整理的这篇文章主要介绍了asp.net-core – 如何在使用asp.net 5时更改登录URL前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我使用asp.net 5和Identity 3来验证用户,但它总是重定向到默认的登录URL,即“帐户/登录”.我想改变它,但似乎没有任何地方可以设置这个选项.我在Configure()方法中使用AddIdentity().请帮忙.
谢谢

解决方法

app.UseCookieAuthentication(options =>
{
    options.LoginPath = new PathString("/Admin/Login");
    options.logoutPath = new PathString("/Admin/logoff");
},IdentityOptions.ApplicationCookieAuthenticationScheme
);
原文链接:https://www.f2er.com/aspnet/247092.html

猜你在找的asp.Net相关文章