Brook.Totp 1.0.3

双因素认证,从共享密钥和当前时间计算一次性密码的算法.
From AspNetCore.Totp

Install-Package Brook.Totp -Version 1.0.3
dotnet add package Brook.Totp --version 1.0.3
<PackageReference Include="Brook.Totp" Version="1.0.3" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Brook.Totp --version 1.0.3
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
services.AddBrookTotp();
private readonly ITotp _totp;
public AccountController(ITotp totp)
{
        _totp = totp;
}

[Authorize]
public IActionResult GetQr()
{
    var totpSetup = _totp.GenerateUrl("dotNETBuild", CurremtUser.Email, CurremtUser.SecretKeyFor2FA);

    return Json(new { qrCodeContennt = totpSetup.QrCodeImageContent });
}


[Authorize]
[HttpPost]
public async Task<IActionResult> Valid(int code)
{
    var valid = _totp.Validate(CurremtUser.SecretKeyFor2FA
        , code, 30);
}

services.AddBrookTotp();
private readonly ITotp _totp;
public AccountController(ITotp totp)
{
        _totp = totp;
}

[Authorize]
public IActionResult GetQr()
{
    var totpSetup = _totp.GenerateUrl("dotNETBuild", CurremtUser.Email, CurremtUser.SecretKeyFor2FA);

    return Json(new { qrCodeContennt = totpSetup.QrCodeImageContent });
}


[Authorize]
[HttpPost]
public async Task<IActionResult> Valid(int code)
{
    var valid = _totp.Validate(CurremtUser.SecretKeyFor2FA
        , code, 30);
}

This package is not used by any popular GitHub repositories.

Version History

Version Downloads Last updated
1.0.3 58 8/17/2019
1.0.2 45 8/16/2019