
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.
Once the NuGet package is installed, the package source will be copied to ~/App_Plugins/Drawing_Captcha/
.
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>
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.
Navigate to drawing-captcha > api-keys to create a new API key.
Create an API key:
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.
Here you can see that the drawing captcha is active:
This project is licensed under the MIT License.
For issues or contributions, please visit the GitHub repository.