1

Is there a way to rewrite this method from ASP.NET Identity 3 SignInManager with ASP.NET Identity 2?

https://github.com/aspnet/Identity/blob/dev/src/Microsoft.AspNet.Identity/SignInManager.cs#L110

    /// <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);
    }
4

0 回答 0