有没有办法更改为TwoFactor身份验证设置的Cookie

时间:2019-04-10 16:12:57

标签: asp.net-identity

我需要设置两个因素身份cookie,以便每个浏览器(不跨浏览器)记住两个星期。

我看到我们设置了一个cookie,但这是为了会话超时。

我希望停留15分钟,但是只要它们在同一浏览器上,我就不想强迫他们每次都重新输入MFA代码。

有没有办法拥有2个app.UseCookieAuthentication()?一个控制会话,另一个控制两个因素?

// Enable the application to use a cookie to store information for the signed   
// in user and to use a cookie to temporarily store information about a user 
// logging in with a third party login provider Configure the sign in cookie
app.UseCookieAuthentication(new CookieAuthenticationOptions
    {
        AuthenticationType = defaultAuth,
        LoginPath = logInPath,
        CookieName = MiddlewareConstants.AppCookie,
        CookieSecure = CookieSecureOption.Always,
        SlidingExpiration = true,
        ExpireTimeSpan = TimeSpan.FromMinutes(sessionTimeout)
    });

我想要两个cookie认证。

是否可以为UseCookieAuthentication和UseTwoFactorRememberBrowserCookie使用一个?

或者您只能有一个,并且必须是一个或另一个吗?

0 个答案:

没有答案
相关问题