1
0
mirror of https://github.com/XFox111/SimpleOTP.git synced 2026-04-22 08:00:45 +03:00
Files
SimpleOTP/libraries/SimpleOTP.DependencyInjection/OtpOptions.cs
T
xfox111 1b989e7b35 Major 2.0 (#20)
* New 2.0 version + DependencyInjection library

* Updated docs and repo settings (devcontainers, vscode, github, etc.)

* Added tests

* Fixed bugs

* Minor test project refactoring

* Updated projects
- Added symbol packages
- Updated package versions to pre-release

* Updated SECURITY.md

* Added GitHub Actions workflows
2024-09-26 03:20:30 +03:00

58 lines
1.4 KiB
C#

using System.Collections.Specialized;
namespace SimpleOTP.DependencyInjection;
/// <summary>
/// Provides options for the One-Time Password service.
/// </summary>
public class OtpOptions
{
/// <summary>
/// The name of the issuer.
/// </summary>
public required string Issuer { get; set; }
/// <summary>
/// The issuer domain.
/// </summary>
/// <remarks>
/// <b>IMPORTANT:</b> Using this property will imply adherence to the Apple specification.
/// </remarks>
public string? IssuerDomain { get; set; }
/// <summary>
/// The algorithm to use.
/// </summary>
public OtpAlgorithm Algorithm { get; set; } = OtpAlgorithm.SHA1;
/// <summary>
/// The number of digits in the OTP code.
/// </summary>
public int Digits { get; set; } = 6;
/// <summary>
/// The number of seconds between each OTP code.
/// </summary>
public int Period { get; set; } = 30;
/// <summary>
/// The type of One-Time Password to generate.
/// </summary>
public OtpType Type { get; set; } = OtpType.Totp;
/// <summary>
/// The format of OTP URIs.
/// </summary>
public OtpUriFormat UriFormat { get; set; } = OtpUriFormat.Google | OtpUriFormat.Minimal;
/// <summary>
/// The tolerance span for the OTP codes validation.
/// </summary>
public ToleranceSpan ToleranceSpan { get; set; } = ToleranceSpan.Default;
/// <summary>
/// Custom properties to place in OTP URIs.
/// </summary>
public NameValueCollection CustomProperties { get; } = [];
}