标签: two-factor-authentication

推送到GitHub时2FA会出现问题

我在我的Raspberry Pi上的GitHub上克隆了一个项目,创建了一个新的分支并将所有内容都推送到了存储库.为此我需要下一个命令:

git clone https://www.github.com/heinpauwelyn/my_repo
git checkout -b raspberry
git push origin raspberry
Run Code Online (Sandbox Code Playgroud)

我遇到的问题是我无法将分支机构推向GitHub.com.我需要输入我的用户名和密码,但我不能使用2FA.这是Git或GitHub中的错误,是否有办法获取身份验证密钥并输入?

我不会在GitHub上启用2FA.

git github git-push two-factor-authentication

16
推荐指数
4
解决办法
8150
查看次数

更改默认ASP.NET身份双因素记住Cookie过期时间

我一直在使用ASP.NET Identity 2.2.1.以下是VerifyCode操作的post方法中的代码.

var result = await SignInManager.TwoFactorSignInAsync(model.Provider, model.Code, isPersistent: model.RememberMe, rememberBrowser: model.RememberBrowser);

switch (result)
{
    case SignInStatus.Success:
        return RedirectToAction("Dashboard","Index");
    case SignInStatus.LockedOut:
        return View("Lockout");
    case SignInStatus.Failure:
    default:
        ModelState.AddModelError("", "Invalid code.");
        return View(model);
}
Run Code Online (Sandbox Code Playgroud)

当model.RememberMe和model.RememberBrowser都为true时,浏览器会记住Identity和两个因子cookie 2周.这是默认实现.

但我只需要记住TFA 8小时.我怎样才能做到这一点?

自从过去10天以来,我一直在寻找解决方案,但我还没有找到解决方案.任何帮助将非常感激.

以下是我的StartUp类中的代码.它只是没有生效.

public partial class Startup
{
    // For more information on configuring authentication, please visit http://go.microsoft.com/fwlink/?LinkId=301864
    public void ConfigureAuth(IAppBuilder app)
    {
        // Configure the db context, user manager and signin manager to use a single instance per request
        app.CreatePerOwinContext(ApplicationDbContext.Create);
        app.CreatePerOwinContext<ApplicationUserManager>(ApplicationUserManager.Create);
        app.CreatePerOwinContext<ApplicationSignInManager>(ApplicationSignInManager.Create);
        app.CreatePerOwinContext<ApplicationRoleManager>(ApplicationRoleManager.Create); …
Run Code Online (Sandbox Code Playgroud)

c# asp.net-mvc remember-me two-factor-authentication asp.net-identity-2

12
推荐指数
1
解决办法
3720
查看次数

如何使用 SourceTree 配置 Bitbucket 应用程序密码?

我在 Bitbucket 中启用了双因素身份验证,然后创建了一个应用程序密码。我应该在 SourceTree 中哪里配置此应用密码?

ssh configuration bitbucket two-factor-authentication atlassian-sourcetree

12
推荐指数
2
解决办法
2万
查看次数

如何将Google身份验证器添加到我的网站?

我有一个Web应用程序,前端是Angular2,后端是NodeJS.我希望允许客户使用Google身份验证器使其帐户更安全.

如何在我的网站中实施/使用Google身份验证器?我找不到要使用的API或要跟随的教程或要使用的任何库.我在哪里可以找到一些资源来做到这一点?

javascript google-authentication node.js two-factor-authentication

11
推荐指数
1
解决办法
2万
查看次数

使用git send-mail和谷歌2因素身份验证

我想使用git send-mail上游提交补丁,但我的Gmail帐户使用双因素身份验证.谷歌为这样的事情提供了应用程序专用密码,但我的问题是存储此密码以便与git send-mail一起使用的安全位置在哪里?

git gmail two-factor-authentication

10
推荐指数
1
解决办法
2716
查看次数

Sourcetree添加了两个因子身份验证bitbucket

我为我的bitbucket帐户启用了双因素身份验证.现在Osx上的Atlassian Sourcetree应用程序不起作用,它无法登录bitbucket.

我如何配置SourceTree使用bitbucket双因素auth?

bitbucket two-factor-authentication atlassian-sourcetree

10
推荐指数
2
解决办法
6312
查看次数

是否应该对 2FA 密码进行散列存储?

我正在我们的网站上使用 Google Authenticator 实施 2FA。如果我理解正确,每个用户都有自己的密码,我需要在登录时验证他们输入的 6 位密码。

将这些密码与用户密码存储在同一个数据库中似乎是一个坏主意(虽然,如果有人掌握了数据库,我们会遇到更大的问题),是否还有办法解决?还是应该将它们视为密码并进行加密?

security two-factor-authentication laravel-5

10
推荐指数
1
解决办法
2564
查看次数

如何使用ansible进行双因素身份验证?

我已经使用duosecurity为ssh启用了双因素身份验证(使用此playbook https://github.com/CoffeeAndCode/ansible-duo).

如何使用ansible立即管理服务器.由于这个原因,SSH调用在收集事实时失败.我希望运行剧本的人在播放剧本之前输入两个因子代码.

为部署用户禁用两个因素是一种可能的解决方案,但会产生一个安全问题,我希望避免这种问题.

ssh two-factor-authentication ansible ansible-playbook

9
推荐指数
2
解决办法
7054
查看次数

在2因素身份验证中使用什么HTTP状态

我的网站工作流程是用户提交用户名和密码.然后,如果启用2因素身份验证,我的网站将要求客户端通过模式对话输入2因子令牌.

我的问题是我应该使用什么HTTP状态代码来通知jQuery提示用户输入2因子令牌?

我正在考虑200 OK但这可能会产生误导,因为它与成功登录相同. 100 Continue也可以是候选人,但它根本不符合RFC7231.

http-status-codes two-factor-authentication

9
推荐指数
1
解决办法
1802
查看次数

使用 otp.net 生成和验证 OTP 代码

我正在使用Otp.NET库来生成和验证 OTP。我想使用TOTP算法。生成的 OTP 有效期需为 5 分钟。图书馆建议var totp = new Totp(secretKey, step: 300);为此使用。但是OTP在5分钟之前就失效了

完整代码

public static void GenarateTOTP()
        {
            var bytes = Base32Encoding.ToBytes("JBSWY3DPEHPK3PXP");

            var totp = new Totp(bytes, step: 300);

            var result = totp.ComputeTotp(DateTime.UtcNow);

            Console.WriteLine(result);

            var input = Console.ReadLine();
            long timeStepMatched;
            bool verify = totp.VerifyTotp(input, out timeStepMatched, window: null);

            Console.WriteLine("{0}-:{1}", "timeStepMatched",timeStepMatched);
            Console.WriteLine("{0}-:{1}", "Remaining seconds", totp.RemainingSeconds());
            Console.WriteLine("{0}-:{1}", "verify", verify);

        } 
Run Code Online (Sandbox Code Playgroud)

c# one-time-password two-factor-authentication totp

9
推荐指数
1
解决办法
2万
查看次数