MyPasswordStrength.NET.MAUI
1.0.0
dotnet add package MyPasswordStrength.NET.MAUI --version 1.0.0
NuGet\Install-Package MyPasswordStrength.NET.MAUI -Version 1.0.0
<PackageReference Include="MyPasswordStrength.NET.MAUI" Version="1.0.0" />
<PackageVersion Include="MyPasswordStrength.NET.MAUI" Version="1.0.0" />
<PackageReference Include="MyPasswordStrength.NET.MAUI" />
paket add MyPasswordStrength.NET.MAUI --version 1.0.0
#r "nuget: MyPasswordStrength.NET.MAUI, 1.0.0"
#:package MyPasswordStrength.NET.MAUI@1.0.0
#addin nuget:?package=MyPasswordStrength.NET.MAUI&version=1.0.0
#tool nuget:?package=MyPasswordStrength.NET.MAUI&version=1.0.0
MyPasswordStrength.NET.MAUI
A .NET MAUI library for validating password strength based on customizable complexity requirements.
Background
Define your password strength complexity requirements with ease using the library.
The package provides a PasswordStrengthEntry Entry that you can use to validate passwords in your .NET MAUI applications.
You can set the password strength requirements through the properties of the MyPasswordStrengthOptions class and pass the options to the Entry.
The special characters considered in the validation are: @$!%*?&.
You can modify this set of special characters by setting the SpecialCharacters property of the options to a custom string of special characters.
Sample Usage
using Microsoft.Maui.Controls.Shapes;
using MyPasswordStrength;
using System.Runtime.Versioning;
namespace MyTestMAUIAPP.Pages;
[SupportedOSPlatform("android")]
[SupportedOSPlatform("ios")]
[SupportedOSPlatform("maccatalyst")]
[SupportedOSPlatform("windows")]
public class Registration : ContentPage
{
private readonly PasswordStrengthEntry _entry;
private readonly Border _border;
private readonly Label _errorLabel;
public Registration()
{
var content = new VerticalStackLayout
{
Children = {
new Label {
HorizontalOptions = LayoutOptions.Center,
VerticalOptions = LayoutOptions.Center,
Text = "Welcome to .NET MAUI!"
}
}
};
_entry = new PasswordStrengthEntry(HandleOnValidation, GetOptions(), "Enter your password")
{
HorizontalOptions = LayoutOptions.Fill,
VerticalOptions = LayoutOptions.Fill
};
_border = new Border
{
Stroke = Colors.Black, // Border color
StrokeThickness = 1, // Border width in device-independent units
StrokeShape = new Rectangle(), //Square border
Margin = 10,
Content = _entry
};
_errorLabel = new Label
{
Text = "Password must be at least 9 chars, 2 uppercase, 3 lowercase, 2 digit, 2 special char, no more than 2 same consecutive chars, no more than 3 consecutive ascending digits, no more than 3 consecutive descending digits",
TextColor = Colors.Red,
HorizontalOptions = LayoutOptions.Center,
VerticalOptions = LayoutOptions.Center,
IsVisible = false
};
content.Children.Add(_border);
content.Children.Add(_errorLabel);
Content = content;
}
private MyPasswordStrengthOptions GetOptions()
{
var options = new MyPasswordStrengthOptions();
options.MinimumLength = 9;
options.RequireUppercase = true;
options.MinimumUppercase = 2;
options.RequireLowercase = true;
options.MinimumLowercase = 3;
options.RequireDigit = true;
options.MinimumDigit = 2;
options.RequireSpecialCharacter = true;
options.MinimumSpecialCharacter = 2;
options.RequireMaximumNoOfSameConsecutiveCharacters = true;
options.MaximumNoOfSameConsecutiveCharacters = 2;
options.RequireMaximumNoOfConsecutiveAscendingDigits = true;
options.MaximumNoOfConsecutiveAscendingDigits = MaximumNoOfConsecutiveDigits.Three;
options.RequireMaximumNoOfConsecutiveDescendingDigits = true;
options.MaximumNoOfConsecutiveDescendingDigits = MaximumNoOfConsecutiveDigits.Three;
return options;
}
private async void HandleOnValidation(string pwd, bool isValid)
{
if (isValid)
{
_border.Stroke = Colors.Green;
_errorLabel.IsVisible = false;
}
else
{
_border.Stroke = Colors.Red;
_errorLabel.IsVisible = true;
}
}
}
License
MIT © VeritasSoftware
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-android36.0 is compatible. net10.0-browser was computed. net10.0-ios was computed. net10.0-ios26.0 is compatible. net10.0-maccatalyst was computed. net10.0-maccatalyst26.0 is compatible. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. net10.0-windows10.0.19041 is compatible. |
-
net10.0
- Microsoft.Maui.Controls (>= 10.0.20)
-
net10.0-android36.0
- Microsoft.Maui.Controls (>= 10.0.20)
-
net10.0-ios26.0
- Microsoft.Maui.Controls (>= 10.0.20)
-
net10.0-maccatalyst26.0
- Microsoft.Maui.Controls (>= 10.0.20)
-
net10.0-windows10.0.19041
- Microsoft.Maui.Controls (>= 10.0.20)
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 |
|---|---|---|
| 1.0.0 | 40 | 6/9/2026 |
Initial release.