Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/typo3/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Asp.net mvc 如何在ASP.Net Identity 2中重写RefreshSign_Asp.net Mvc_Asp.net Identity_Asp.net Identity 2_Asp.net Identity 3 - Fatal编程技术网

Asp.net mvc 如何在ASP.Net Identity 2中重写RefreshSign

Asp.net mvc 如何在ASP.Net Identity 2中重写RefreshSign,asp.net-mvc,asp.net-identity,asp.net-identity-2,asp.net-identity-3,Asp.net Mvc,Asp.net Identity,Asp.net Identity 2,Asp.net Identity 3,有没有办法用ASP.NET Identity 2从ASP.NET Identity 3 SignInManager重写此方法 // ///重新生成用户的应用程序cookie,同时保留现有的 ///身份验证属性,如rememberMe,作为异步操作。 /// ///应刷新其登录cookie的用户。 ///表示异步操作的任务对象。 公共虚拟异步任务RefreshSignInAsync(TUser用户) { var auth=新的AuthenticateContext(IdentityOption

有没有办法用ASP.NET Identity 2从ASP.NET Identity 3 SignInManager重写此方法

//
///重新生成用户的应用程序cookie,同时保留现有的
///身份验证属性,如rememberMe,作为异步操作。
/// 
///应刷新其登录cookie的用户。
///表示异步操作的任务对象。
公共虚拟异步任务RefreshSignInAsync(TUser用户)
{
var auth=新的AuthenticateContext(IdentityOptions.ApplicationCookieAuthenticationScheme);
wait Context.Authentication.authenticateSync(auth);
var authenticationMethod=auth.Principal?.FindFirstValue(ClaimTypes.authenticationMethod);
等待签名同步(用户、新身份验证属性(auth.Properties)、身份验证方法);
}
    /// <summary>
    /// Regenerates the user's application cookie, whilst preserving the existing
    /// AuthenticationProperties like rememberMe, as an asynchronous operation.
    /// </summary>
    /// <param name="user">The user whose sign-in cookie should be refreshed.</param>
    /// <returns>The task object representing the asynchronous operation.</returns>
    public virtual async Task RefreshSignInAsync(TUser user)
    {
        var auth = new AuthenticateContext(IdentityOptions.ApplicationCookieAuthenticationScheme);
        await Context.Authentication.AuthenticateAsync(auth);
        var authenticationMethod = auth.Principal?.FindFirstValue(ClaimTypes.AuthenticationMethod);
        await SignInAsync(user, new AuthenticationProperties(auth.Properties), authenticationMethod);
    }