简体   繁体   English

ASP.NET5 beta8 IServiceCollection的更改

[英]ASP.NET5 beta8 IServiceCollection changes

After updating my project to recently released ASP.NET 5 beta8 I've found that IServiceCollection no longer contains definition for ConfigureIdentity and ConfigureIdentityApplicationCookie . 将项目更新为最近发布的ASP.NET 5 beta8之后,我发现IServiceCollection不再包含ConfigureIdentityConfigureIdentityApplicationCookie定义。

So previously written code like 所以以前写的代码像

services.ConfigureIdentity(o =>
    {
        o.Password.RequireUppercase = false;
        o.Password.RequireNonLetterOrDigit = false;
    });

services.ConfigureIdentityApplicationCookie(o => o.LoginPath = "/Admin/Users/Login");

can't be compiled anymore. 不能再编译了。

Google search brings no result, I suppose it is because only one day has passed since beta8 release. Google搜索没有带来任何结果,我想这是因为自beta8发布以来仅过了一天。

Has anyone found workaround for this? 有人找到解决方法吗? How should identity options be configured in beta8? 如何在beta8中配置身份选项?

The Configure* methods are removed and the Add* methods now accept an Action<TOptions> : 删除Configure*方法,并且Add*方法现在接受Action<TOptions>

services.AddIdentity<TUser, TRole>(o =>
{
    o.Password.RequireUppercase = false;
    o.Password.RequireNonLetterOrDigit = false;
    o.Cookies.ApplicationCookie.LoginPath = "/Admin/Users/Login";
});

Not exactly, but partially related: https://github.com/aspnet/Announcements/issues/71 不完全相同,但部分相关: https : //github.com/aspnet/Announcements/issues/71

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM