| 12345678910111213141516171819202122232425262728293031323334353637383940414243 |
- using Fido2NetLib;
- var builder = WebApplication.CreateBuilder(args);
- // Add services to the container.
- // Learn more about configuring Swagger/OpenAPI at https://aka.ms/aspnetcore/swashbuckle
- builder.Services.AddEndpointsApiExplorer();
- 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();
- // Configure the HTTP request pipeline.
- if (app.Environment.IsDevelopment())
- {
- app.UseSwagger();
- app.UseSwaggerUI();
- }
- app.UseStaticFiles();
- app.UseHttpsRedirection();
- var summaries = new[]
- {
- "Freezing", "Bracing", "Chilly", "Cool", "Mild", "Warm", "Balmy", "Hot", "Sweltering", "Scorching"
- };
- app.MapGet("/buildCredentialOptions", (IFido2 fido2) =>
- {
- var data = File.ReadAllText("./data/test.json");
- return data;
- })
- .WithName("BuildCredentialOptions")
- .WithOpenApi();
- app.Run();
|