Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions Demo/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,21 @@
app.UseHttpsRedirection();

app.UseSession();

// Serve the .well-known/webauthn file for WebAuthn related origins
// Can be overridden via WEBAUTHN_WELL_KNOWN environment variable (JSON string)
app.MapGet("/.well-known/webauthn", (IWebHostEnvironment env, IConfiguration config) =>
{
var envContent = config["WEBAUTHN_WELL_KNOWN"];
if (!string.IsNullOrEmpty(envContent))
{
return Results.Content(envContent, "application/json");
}
return Results.File(Path.Combine(env.WebRootPath, ".well-known", "webauthn"), "application/json");
});

app.UseStaticFiles();

app.UseRouting();

app.MapFallbackToPage("/", "/overview");
Expand Down
5 changes: 5 additions & 0 deletions Demo/wwwroot/.well-known/webauthn
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"origins": [
"https://fido3.andersaberg.com"
]
}