哪里是在Microsoft.AspNet.Identity.Owin.AuthenticationManager身份Asp.Net RTM版本? [英] Where is Microsoft.AspNet.Identity.Owin.AuthenticationManager in Asp.Net Identity RTM version?

查看:206
本文介绍了哪里是在Microsoft.AspNet.Identity.Owin.AuthenticationManager身份Asp.Net RTM版本?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在这里将ASPNET身份组件的每日构建一>

I have installed the nightly build of the AspNet-identity assemblies from here

这似乎从RC版本的的AuthenticationManager 类是从RTM版本( Microsoft.AspNet.Identity.Owin.1.0.0-rtm-不见了130914 的)。

It seems that the AuthenticationManager class from the RC version is gone from the RTM version (Microsoft.AspNet.Identity.Owin.1.0.0-rtm-130914).

它曾经是在 Microsoft.AspNet.Identity.Owin 的组件,但它不再存在。

It used to be in the Microsoft.AspNet.Identity.Owin assembly, but its no longer there.

本类有方法: SignInAsync CheckPasswordAndSignInAsync 是在默认项目中使用你创建新的时候得到ASP.Net Web应用程序的MVC项目,单个用户帐户验证。

This class had the methods: SignInAsync and CheckPasswordAndSignInAsync that are used in the default project you get when creating new ASP.Net web application MVC project with Individual User Account authentication.

哪里的AuthenticationManager现在呢?或者改用什么?

Where is the AuthenticationManager now? Or what to use instead?

推荐答案

这班走了,因为它基本上只是增加了生成的ClaimsIdentity并通过了到Owin.Security.IAuthenticationManager。

That class is gone, as it was basically just adding methods that generated a ClaimsIdentity and passed that into an Owin.Security.IAuthenticationManager.

取而代之的是RTM模板具有一个控制器中的签到方式,看起来是这样的:

Instead the RTM templates have a SignIn method in the controller that looks something like this:

    private async Task SignInAsync(ApplicationUser user, bool isPersistent) {
        AuthenticationManager.SignOut(DefaultAuthenticationTypes.ExternalCookie);
        var identity = await UserManager.CreateIdentityAsync(user, DefaultAuthenticationTypes.ApplicationCookie);
        AuthenticationManager.SignIn(new AuthenticationProperties() { IsPersistent = isPersistent }, identity);
    }

这篇关于哪里是在Microsoft.AspNet.Identity.Owin.AuthenticationManager身份Asp.Net RTM版本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆