我在我的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.
我一直在使用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
我在 Bitbucket 中启用了双因素身份验证,然后创建了一个应用程序密码。我应该在 SourceTree 中哪里配置此应用密码?
ssh configuration bitbucket two-factor-authentication atlassian-sourcetree
我有一个Web应用程序,前端是Angular2,后端是NodeJS.我希望允许客户使用Google身份验证器使其帐户更安全.
如何在我的网站中实施/使用Google身份验证器?我找不到要使用的API或要跟随的教程或要使用的任何库.我在哪里可以找到一些资源来做到这一点?
javascript google-authentication node.js two-factor-authentication
我想使用git send-mail上游提交补丁,但我的Gmail帐户使用双因素身份验证.谷歌为这样的事情提供了应用程序专用密码,但我的问题是存储此密码以便与git send-mail一起使用的安全位置在哪里?
我为我的bitbucket帐户启用了双因素身份验证.现在Osx上的Atlassian Sourcetree应用程序不起作用,它无法登录bitbucket.
我如何配置SourceTree使用bitbucket双因素auth?
我正在我们的网站上使用 Google Authenticator 实施 2FA。如果我理解正确,每个用户都有自己的密码,我需要在登录时验证他们输入的 6 位密码。
将这些密码与用户密码存储在同一个数据库中似乎是一个坏主意(虽然,如果有人掌握了数据库,我们会遇到更大的问题),是否还有办法解决?还是应该将它们视为密码并进行加密?
我已经使用duosecurity为ssh启用了双因素身份验证(使用此playbook https://github.com/CoffeeAndCode/ansible-duo).
如何使用ansible立即管理服务器.由于这个原因,SSH调用在收集事实时失败.我希望运行剧本的人在播放剧本之前输入两个因子代码.
为部署用户禁用两个因素是一种可能的解决方案,但会产生一个安全问题,我希望避免这种问题.
我的网站工作流程是用户提交用户名和密码.然后,如果启用2因素身份验证,我的网站将要求客户端通过模式对话输入2因子令牌.
我的问题是我应该使用什么HTTP状态代码来通知jQuery提示用户输入2因子令牌?
我正在考虑200 OK但这可能会产生误导,因为它与成功登录相同.
100 Continue也可以是候选人,但它根本不符合RFC7231.
我正在使用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) bitbucket ×2
c# ×2
git ×2
ssh ×2
ansible ×1
asp.net-mvc ×1
git-push ×1
github ×1
gmail ×1
javascript ×1
laravel-5 ×1
node.js ×1
remember-me ×1
security ×1
totp ×1