BlazorVerificationCaptcha 0.1.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package BlazorVerificationCaptcha --version 0.1.0                
NuGet\Install-Package BlazorVerificationCaptcha -Version 0.1.0                
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="BlazorVerificationCaptcha" Version="0.1.0" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add BlazorVerificationCaptcha --version 0.1.0                
#r "nuget: BlazorVerificationCaptcha, 0.1.0"                
#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.
// Install BlazorVerificationCaptcha as a Cake Addin
#addin nuget:?package=BlazorVerificationCaptcha&version=0.1.0

// Install BlazorVerificationCaptcha as a Cake Tool
#tool nuget:?package=BlazorVerificationCaptcha&version=0.1.0                

BlazorVerificationCaptcha

A simple solution to verify users using a simple captcha with a current limit of six characters (changed in next update).

Technologies

Created using

  • .NET Core 6.0

NuGet/Dependencies used

Features

Nuget

General

  • Provides a simple and easy-to-use solution for implementing captcha verification in Blazor applications.
  • The current version supports a captcha length of up to six characters.

Usage (For more, see examples)

To use BlazorVerificationCaptcha in your Blazor application, follow these steps:

  1. Install the BlazorVerificationCaptcha package from NuGet.
  2. Add @using BlazorVerificationCaptcha inside the _Imports.razor
  3. Implement the captcha component in your desired location, by adding <VerificationCaptcha />
  4. Add ExampleVariable = VerificationCaptcha.CaptchaBackup; inside OnInitializedAsync(), as this code generates the image

Example (Component)

Here is an example of how you can use BlazorVerificationCaptcha in your Blazor component:

<VerificationCaptcha />

@code {

    private string ExampleVariable;

    protected override Task OnInitializedAsync()
    {
        ExampleVariable = VerificationCaptcha.CaptchaBackup;
        return base.OnInitializedAsync();
    }
}

Example (Generator)

Here is an example of how you can use the generator without the component, to get the values and display it by yourself

<p>@ExampleVariable.Text</p>
<p>@ExampleVariable.Image</p>

@code {

    private (string Image, string Text) ExampleVariable;

    protected override Task OnInitializedAsync()
    {
        ExampleVariable = CaptchaGenerator.GenerateCaptcha();
        return base.OnInitializedAsync();
    }
}

This example doesn't show how to handle checking if the captcha is correct but you have the ExampleVariable, so you can easily just do if(ExampleVariable.Equals(ExampleInputVariable, StringComparison.InvariantCulture)).

FAQ

What do I have to be aware of?

The image is displayed using base64, which adds some overhead. You should test if this method meets your requirements. In future updates, an alternative way of displaying the captcha image will be implemented.

License

Software: BlazorVerificationCaptcha

License: GNU General Public License v3.0

Roadmap

  • Implement an alternative way to display the captcha image, besides base64
  • Allow customization of the captcha length, dimension etc.
  • Maybe implement features for barrier free things like text2speech etc.
Product Compatible and additional computed target framework versions.
.NET net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  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. 
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
0.1.2 208 8/20/2023
0.1.1 155 6/14/2023
0.1.0 143 6/13/2023

Created the library