ASP.NET5 beta8 IServiceCollection更改

And*_*yev 2 c# asp.net asp.net-identity asp.net-core

将我的项目更新到最近发布的ASP.NET 5 beta8后,我发现IServiceCollection不再包含ConfigureIdentity和的定义ConfigureIdentityApplicationCookie.

所以以前编写的代码就像

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

services.ConfigureIdentityApplicationCookie(o => o.LoginPath = "/Admin/Users/Login");
Run Code Online (Sandbox Code Playgroud)

不能再编译了.

谷歌搜索没有结果,我想这是因为自beta8发布以来仅过了一天.

有没有人为此找到解决方法?如何在beta8中配置身份选项?

Hen*_*ema 5

Configure*方法被去除,Add*方法现在接受Action<TOptions>:

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

不完全,但部分相关:https://github.com/aspnet/Announcements/issues/71