SeliseBlocks.MfaDriver 8.0.0-preview.8

This is a prerelease version of SeliseBlocks.MfaDriver.
There is a newer prerelease version of this package available.
See the version list below for details.
dotnet add package SeliseBlocks.MfaDriver --version 8.0.0-preview.8
                    
NuGet\Install-Package SeliseBlocks.MfaDriver -Version 8.0.0-preview.8
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="SeliseBlocks.MfaDriver" Version="8.0.0-preview.8" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="SeliseBlocks.MfaDriver" Version="8.0.0-preview.8" />
                    
Directory.Packages.props
<PackageReference Include="SeliseBlocks.MfaDriver" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add SeliseBlocks.MfaDriver --version 8.0.0-preview.8
                    
#r "nuget: SeliseBlocks.MfaDriver, 8.0.0-preview.8"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#addin nuget:?package=SeliseBlocks.MfaDriver&version=8.0.0-preview.8&prerelease
                    
Install SeliseBlocks.MfaDriver as a Cake Addin
#tool nuget:?package=SeliseBlocks.MfaDriver&version=8.0.0-preview.8&prerelease
                    
Install SeliseBlocks.MfaDriver as a Cake Tool

SeliseBlocks.MfaDriver

Overview

SeliseBlocks.MfaDriver is a MFA driver designed to integrate MFA functionalities into your application. It provides a standardized way to generate, verify and manage MFA.

Installation

To install SeliseBlocks.MfaDriver, add the NuGet package to your project:

dotnet add package SeliseBlocks.MfaDriver

Usage

Register Dependencies

Before using SeliseBlocks.MfaDriver, ensure that all required dependencies are registered in your application's dependency injection container. Add the following line in your Program.cs:

use the namespace

using Blocks.Extension.DependencyInjection;

register the service

builder.Services.RegisterBlocksMfaService();

This method will configure and register all necessary services required for the MFA driver to function properly.

Features

  • Generate OTP

    var request = new OtpGenerationRequest
    {
        UserId = <string>,
        ProjectKey = <string>
    }
    

    Invoke GenerateOtpAsync

    await GenerateOtpAsync(request);
    
  • Verify OTP

    var request = new VerifyOtpAsync
    {
        VerificationCode = <string>,
        TwoFactorId = <string>,
        AuthType = <Enum>, //None,TOTP,Email
        ProjectKey = <string>
    }
    

    Invoke VerifyOtpAsync

    await VerifyOtpAsync(request);
    
  • Manage User MFA

    var userMfa = new UserMfaConfiguration
    {
        UserId = <string>,
        MfaEnabled = <string>,
        AuthType = <Enum>, //None,TOTP,Email
        ProjectKey = <string>
    }
    

    Invoke ManageUserMfaAsync

    await ManageUserMfaAsync(request);
    

use the below namespace before invoking any of the methods.

using Blocks.MfaDriver;
Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
8.0.0-preview.9 42 4/7/2025
8.0.0-preview.8 432 3/25/2025
8.0.0-preview.7 438 3/25/2025
8.0.0-preview.6 108 3/18/2025
8.0.0-preview.5 107 3/17/2025
8.0.0-preview.4 110 3/17/2025
8.0.0-preview.3 124 3/10/2025
8.0.0-preview.2 55 2/27/2025