【发布时间】:2018-05-16 02:17:00
【问题描述】:
我的ConfigureServices如下:
services.AddAuthentication(options =>
{
options.DefaultSignInScheme = CookieAuthenticationDefaults.AuthenticationScheme;
options.DefaultAuthenticateScheme = CookieAuthenticationDefaults.AuthenticationScheme;
options.DefaultChallengeScheme = CookieAuthenticationDefaults.AuthenticationScheme;
})
.AddCookie(o =>
{
o.LoginPath = "/User/Login";
});
当需要授权的页面被调用时,它会被重定向到登录页面,其 URL 类似于 localhost:58731/User/Login?ReturnUrl=%2F
我怎样才能像这样设置这个网址:localhost:58731/Login/%2F
谢谢。
【问题讨论】:
标签: authorization asp.net-core-2.0 razor-pages