Skip to content

Drawing-Captcha/NuGet

Repository files navigation

Drawing Captcha Umbraco Integration

Drawing Captcha Request Flow

This is the NuGet package for .NET 8 .NET Core applications, primarily written to extend the Umbraco Forms Integration. You can find the package on NuGet.

Installation

Once the NuGet package is installed, the package source will be copied to ~/App_Plugins/Drawing_Captcha/.

Setup

Script Integration

After installation, implement the script that triggers the drawing captcha attributes. It is recommended to place this script in the base page view to ensure it is rendered after the form:

<script src="~/App_Plugins/Drawing_Captcha/captcha.js" onload="initializeCaptcha()"></script>

Example integration in a Razor view:

@using System.Globalization
@inherits UmbracoViewPage<IBasePage>
@using Microsoft.Extensions.Configuration
@inject IConfiguration Configuration
@inject Microsoft.AspNetCore.Http.IHttpContextAccessor HttpContextAccessor

<!DOCTYPE html>
<html>
<head>
</head>
<body>
    @await Html.PartialAsync("Partials/Header")
    @RenderBody()
    @await Html.PartialAsync("Partials/Footer")
    <script src="~/App_Plugins/Drawing_Captcha/captcha.js" onload="initializeCaptcha()"></script>
</body>
</html>

Configuration

Ensure your API key and server are configured in appsettings.json:

"Forms": {
    "FieldTypes": {
        "DrawingCaptcha": {
            "APIKey": "yourapikey",
            "Server": "https://yourdrawingcaptchainstance.com/"
        }
    }
}

You can obtain an API key by creating a company account if you haven't done so already. Make sure to allow the origin that will be using the drawing captcha.

Origin Setup

API Key Management

Navigate to drawing-captcha > api-keys to create a new API key.

API Key Navigation

Create an API key:

API Key Creation

Umbraco Backoffice Integration

After setting up the configuration, navigate to the Umbraco Forms backoffice. You should see the extended field type added by the package, indicating that the drawing captcha is active.

Field Type Added

Here you can see that the drawing captcha is active:

Captcha Active

Additional Resources

License

This project is licensed under the MIT License.

Contact

For issues or contributions, please visit the GitHub repository.

About

Drawing Captcha Umbraco Integration

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published