2016-02-03 60 views
3

我使用vNext,它运行良好本地主机,但在服务器重定向登录功能确实发送给我正确的网址(XXX /帐户/登录?ReturnUrl =%2FMonitoring),但我得到一条错误消息。vNext重定向登录返回404

404 - File or directory not found. 
The resource you are looking for might have been removed, had its name changed, or is temporarily unavailable. 

的方法:

[HttpGet] 
     [AllowAnonymous] 
     public IActionResult Login(string returnUrl) 
     {    
      ViewBag.ReturnUrl = returnUrl; 

      return View(); 
     } 

Startup.cs

app.UseCookieAuthentication(options => 
      { 
       options.AutomaticAuthenticate = true; 
       options.AutomaticChallenge = true; 
       options.AuthenticationScheme = CookieAuthenticationDefaults.AuthenticationScheme;     
       options.CookieName = "WnctAuthCookie"; 
       if (!env.IsDevelopment()) 
        options.CookieSecure = CookieSecureOption.Always; 
       options.ExpireTimeSpan = TimeSpan.FromMinutes(60); 
       options.SlidingExpiration = true; 
       options.LoginPath = new PathString("/Account/Login"); 
       options.LogoutPath = new PathString("/Account/Logout"); 
      }); 

我使用1.0.0-rc1-final,我也使用IIS 7.5在Windows 7下,我有HTTPS启用。

我不确定天气这是由于IIS或其他设置的设置。有没有人有办法解决吗?

+0

并直接导航到“/显示器”的工作? – Thorarins

+0

@ Thorarins登录后,否则会重定向到登录并返回404 –

+0

,因此它无法找到登录名? – Thorarins

回答

1

我不知道,但我认为你有它,输入文件名的扩展名筛选

options.LoginPath = new PathString("/Account/Login.aspx"); 
    options.LogoutPath = new PathString("/Account/Logout.aspx"); 
+0

问题似乎是它不重定向到https –