Skip to content

Commit f5c299b

Browse files
authored
Updated demo to have RoR (#639)
1 parent ca15d09 commit f5c299b

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

Demo/Program.cs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,21 @@
6464
app.UseHttpsRedirection();
6565

6666
app.UseSession();
67+
68+
// Serve the .well-known/webauthn file for WebAuthn related origins
69+
// Can be overridden via WEBAUTHN_WELL_KNOWN environment variable (JSON string)
70+
app.MapGet("/.well-known/webauthn", (IWebHostEnvironment env, IConfiguration config) =>
71+
{
72+
var envContent = config["WEBAUTHN_WELL_KNOWN"];
73+
if (!string.IsNullOrEmpty(envContent))
74+
{
75+
return Results.Content(envContent, "application/json");
76+
}
77+
return Results.File(Path.Combine(env.WebRootPath, ".well-known", "webauthn"), "application/json");
78+
});
79+
6780
app.UseStaticFiles();
81+
6882
app.UseRouting();
6983

7084
app.MapFallbackToPage("/", "/overview");

Demo/wwwroot/.well-known/webauthn

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"origins": [
3+
"https://fido3.andersaberg.com"
4+
]
5+
}

0 commit comments

Comments
 (0)