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

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version History

Version Downloads Last updated
1.0.3 837 8/17/2019
1.0.2 142 8/16/2019