mirror of
https://github.com/btcpayserver/btcpayserver.git
synced 2025-02-23 14:40:36 +01:00
* FIDO2/WebAuthN Support This adds initial support for WebAuthN/FIDO2 as another MFA mode. U2F is still intact and runs alongside it for now. Once this is merged, I will start work on migrating U2F support to happen over the FIDO2 protocol instead. * Refactor and future proof system (prep work of seamless u2f migration) * attempt js fix for mobile devices * Apply suggestions from code review Co-authored-by: d11n <mail@dennisreimann.de> * fix fido name saving * do not spam logs and hide loader when failed * PR Changes * Apply suggestions from code review Co-authored-by: d11n <mail@dennisreimann.de> * attempt fido2 bump * add name if not named for credentials Co-authored-by: d11n <mail@dennisreimann.de>
33 lines
955 B
C#
33 lines
955 B
C#
using System;
|
|
using System.ComponentModel.DataAnnotations.Schema;
|
|
using Microsoft.EntityFrameworkCore;
|
|
|
|
namespace BTCPayServer.Data
|
|
{
|
|
public class Fido2Credential
|
|
{
|
|
public string Name { get; set; }
|
|
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
|
public string Id { get; set; }
|
|
|
|
public string ApplicationUserId { get; set; }
|
|
|
|
public byte[] Blob { get; set; }
|
|
public CredentialType Type { get; set; }
|
|
public enum CredentialType
|
|
{
|
|
FIDO2,
|
|
U2F
|
|
}
|
|
public static void OnModelCreating(ModelBuilder builder)
|
|
{
|
|
builder.Entity<Fido2Credential>()
|
|
.HasOne(o => o.ApplicationUser)
|
|
.WithMany(i => i.Fido2Credentials)
|
|
.HasForeignKey(i => i.ApplicationUserId).OnDelete(DeleteBehavior.Cascade);
|
|
|
|
}
|
|
|
|
public ApplicationUser ApplicationUser { get; set; }
|
|
}
|
|
}
|