CloudBuilder/CloudBuilder.Security/Data/WebAuthnOptions.cs
owenchen 873f65dbbe ow
2026-08-06 13:15:56 +08:00

49 lines
1.6 KiB
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace CloudBuilder.Security.Data
{
/// <summary>
/// Plain-old-data wrapper for the credential fields we persist on
/// SecurityUser. The frontend never sees this type.
/// </summary>
public class StoredBiometricCredential
{
public byte[] CredentialId { get; set; } = Array.Empty<byte>();
public byte[] PublicKey { get; set; } = Array.Empty<byte>();
}
public class WebAuthnOptions
{
/// <summary>
/// Relying Party ID — the registrable domain suffix of the
/// origin's host. For dev: "localhost". For production:
/// "eleave.1010printing.com".
/// </summary>
public string RpId { get; set; } = "localhost";
/// <summary>
/// Human-readable relying-party name. Shown in the OS biometric
/// prompt ("Use HR Plus to sign in to localhost").
/// </summary>
public string RpName { get; set; } = "HR Plus";
/// <summary>
/// The full origin (scheme + host + port) the user is loading
/// the page from. Fido2NetLib verifies the attestation/assertion
/// origin matches this exactly. Must be HTTPS in production
/// (localhost is exempt).
/// </summary>
public string Origin { get; set; } = "https://localhost:8000";
/// <summary>
/// WebAuthn ceremony timeout in milliseconds. Default 60s.
/// </summary>
public int TimeoutMs { get; set; } = 60000;
}
}