This quickstart shows how to use an Entity Framework store for your user's FIDO keys. This uses a nuget package from Rock Solid Knowledge, and provides a custom implementation of IFidoKeyStore
where credential IDs and AAGUIDs are bas64 encoded, and the public keys stored JSON.
Nuget Installation
install-package Rsk.AspNetCore.Fido.EntityFramework
Configuration
To start using the Entity Framework store, simply use the AddEntityFrameworkStore
extension on IFidoBuilder
, passing in your DbContextOptionsBuilder
. The underlying DbContext has no dependencies on database type other than that it must be compatible with Microsoft.EntityFrameworkCore.Relational
.
var migrationsAssembly = typeof(Startup).GetTypeInfo().Assembly.GetName().Name;
services.AddFido()
.AddEntityFrameworkStore(options => options.UseSqlServer(
"<connection_string>", sql => sql.MigrationsAssembly(migrationsAssembly)));
For running migrations, we recommend following the advice in the Entity Framework Core documentation.