|
@@ -1,9 +1,18 @@
|
|
|
|
|
+using Fido2NetLib;
|
|
|
|
|
+
|
|
|
var builder = WebApplication.CreateBuilder(args);
|
|
var builder = WebApplication.CreateBuilder(args);
|
|
|
|
|
|
|
|
// Add services to the container.
|
|
// Add services to the container.
|
|
|
// Learn more about configuring Swagger/OpenAPI at https://aka.ms/aspnetcore/swashbuckle
|
|
// Learn more about configuring Swagger/OpenAPI at https://aka.ms/aspnetcore/swashbuckle
|
|
|
builder.Services.AddEndpointsApiExplorer();
|
|
builder.Services.AddEndpointsApiExplorer();
|
|
|
builder.Services.AddSwaggerGen();
|
|
builder.Services.AddSwaggerGen();
|
|
|
|
|
+builder.Services.AddFido2(options =>
|
|
|
|
|
+{
|
|
|
|
|
+ options.ServerDomain = "localhost";
|
|
|
|
|
+ options.ServerName = "FIDO2 Test";
|
|
|
|
|
+ options.Origins = ["http://localhost:5172"];
|
|
|
|
|
+ options.TimestampDriftTolerance = 300000;
|
|
|
|
|
+});
|
|
|
|
|
|
|
|
var app = builder.Build();
|
|
var app = builder.Build();
|
|
|
|
|
|
|
@@ -22,24 +31,13 @@ var summaries = new[]
|
|
|
"Freezing", "Bracing", "Chilly", "Cool", "Mild", "Warm", "Balmy", "Hot", "Sweltering", "Scorching"
|
|
"Freezing", "Bracing", "Chilly", "Cool", "Mild", "Warm", "Balmy", "Hot", "Sweltering", "Scorching"
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
-app.MapGet("/weatherforecast", () =>
|
|
|
|
|
-{
|
|
|
|
|
- var forecast = Enumerable.Range(1, 5).Select(index =>
|
|
|
|
|
- new WeatherForecast
|
|
|
|
|
- (
|
|
|
|
|
- DateOnly.FromDateTime(DateTime.Now.AddDays(index)),
|
|
|
|
|
- Random.Shared.Next(-20, 55),
|
|
|
|
|
- summaries[Random.Shared.Next(summaries.Length)]
|
|
|
|
|
- ))
|
|
|
|
|
- .ToArray();
|
|
|
|
|
- return forecast;
|
|
|
|
|
-})
|
|
|
|
|
-.WithName("GetWeatherForecast")
|
|
|
|
|
-.WithOpenApi();
|
|
|
|
|
|
|
|
|
|
-app.Run();
|
|
|
|
|
|
|
+app.MapGet("/buildCredentialOptions", (IFido2 fido2) =>
|
|
|
|
|
+ {
|
|
|
|
|
+ var data = File.ReadAllText("./data/test.json");
|
|
|
|
|
+ return data;
|
|
|
|
|
+ })
|
|
|
|
|
+ .WithName("BuildCredentialOptions")
|
|
|
|
|
+ .WithOpenApi();
|
|
|
|
|
|
|
|
-record WeatherForecast(DateOnly Date, int TemperatureC, string? Summary)
|
|
|
|
|
-{
|
|
|
|
|
- public int TemperatureF => 32 + (int)(TemperatureC / 0.5556);
|
|
|
|
|
-}
|
|
|
|
|
|
|
+app.Run();
|