WebAuthn.Net.Storage.MySql 2.0.0

dotnet add package WebAuthn.Net.Storage.MySql --version 2.0.0
                    
NuGet\Install-Package WebAuthn.Net.Storage.MySql -Version 2.0.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="WebAuthn.Net.Storage.MySql" Version="2.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="WebAuthn.Net.Storage.MySql" Version="2.0.0" />
                    
Directory.Packages.props
<PackageReference Include="WebAuthn.Net.Storage.MySql" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add WebAuthn.Net.Storage.MySql --version 2.0.0
                    
#r "nuget: WebAuthn.Net.Storage.MySql, 2.0.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package WebAuthn.Net.Storage.MySql@2.0.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=WebAuthn.Net.Storage.MySql&version=2.0.0
                    
Install as a Cake Addin
#tool nuget:?package=WebAuthn.Net.Storage.MySql&version=2.0.0
                    
Install as a Cake Tool

WebAuthn.Net.Storage.MySql

This project contains an implementation of interfaces responsible for data storage and is intended for use with MySQL 8.0+. MySQL 5.7 is not supported due to the end of life of this version.

Database schema

As the library is intended to be integrated into existing applications, they may have different data schema migration policies. This could be EntityFramework, FluentMigrator, or something else. Migrations may be applied either at the start of the application or by a separate executable application that, for example, runs in a Kubernetes cluster's init-container. It's difficult for us to account for all possible deployment and application scenarios. Therefore, we provide a script for creating a schema, but you need to decide and implement how exactly to integrate it.

Please note that having a unique index on the RpId, UserHandle, and CredentialId columns is required, as the combination of these property values acts as a descriptor, uniquely identifying the public key.

CREATE TABLE `CredentialRecords`
(
    `Id`                        binary(16)      NOT NULL,
    `RpId`                      varchar(256)    NOT NULL,
    `UserHandle`                varbinary(128)  NOT NULL,
    `CredentialId`              varbinary(1024) NOT NULL,
    `Type`                      int             NOT NULL,
    `Kty`                       int             NOT NULL,
    `Alg`                       int             NOT NULL,
    `Ec2Crv`                    int             NULL,
    `Ec2X`                      varbinary(256)  NULL,
    `Ec2Y`                      varbinary(256)  NULL,
    `RsaModulusN`               varbinary(1024) NULL,
    `RsaExponentE`              varbinary(32)   NULL,
    `OkpCrv`                    int             NULL,
    `OkpX`                      varbinary(32)  NULL,
    `SignCount`                 int unsigned    NOT NULL,
    `Transports`                json            NOT NULL,
    `UvInitialized`             tinyint(1)      NOT NULL,
    `BackupEligible`            tinyint(1)      NOT NULL,
    `BackupState`               tinyint(1)      NOT NULL,
    `AttestationObject`         longblob        NULL,
    `AttestationClientDataJson` longblob        NULL,
    `Description`               varchar(200)    NULL,
    `CreatedAtUnixTime`         bigint          NOT NULL,
    `UpdatedAtUnixTime`         bigint          NOT NULL,
    CONSTRAINT `PK_CredentialRecords` PRIMARY KEY (`Id`)
) CHARACTER SET = utf8mb4
  COLLATE = utf8mb4_0900_ai_ci;

CREATE UNIQUE INDEX `IX_CredentialRecords_UserHandle_CredentialId_RpId` ON `CredentialRecords`
(
    `UserHandle`,
    `CredentialId`,
    `RpId`
);

CREATE UNIQUE INDEX `IX_CredentialRecords_CredentialId_RpId` ON `CredentialRecords`
(
     `CredentialId`,
     `RpId`
);

Local dev environment

To start a local test container, execute the following command

docker run -d -e MYSQL_ROOT_PASSWORD=root -p 3306:3306 mysql:8.0.15

Connection string for connecting to the container, the command to start which is presented above.

Don't forget to change the database name specified in the Database parameter to the one you will be using.

Server=localhost;Port=3306;User ID=root;Password=root;Database=webauthn;Pooling=True;Default Command Timeout=30
Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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
2.0.0 81 1/22/2026
1.3.4 814 9/28/2024
1.3.3 755 5/21/2024
1.3.2 361 3/23/2024
1.3.1 290 3/11/2024
1.3.0 308 2/20/2024
1.2.0 241 2/9/2024
1.1.0 245 1/16/2024
1.0.2 197 1/10/2024
1.0.1 207 12/29/2023
1.0.0 217 12/29/2023