Linked accounts: never guess a proof provider; require stepUpRequested; no-store on completion

With no current list the proof goes only through a provider the member names, never the
session's sign-in provider: a sign-in through an unlinked provider makes Heimdall mint an
orphan account holding that login. Link buttons need a current list. The unlink completion
must say a step-up was requested. POST /auth/heimdall/complete answers no-store. The fake
Heimdall now models orphan minting, derives step_up_at from the start's stepUp flag, and
enforces the app secret, sign_in-only, unsupported-provider and 600 s rules.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
Heimdall 2026-11-13 20:08:07 +00:00
commit 8e65f56b0c
7 changed files with 325 additions and 69 deletions

View file

@ -829,6 +829,8 @@ app.MapPost("/auth/heimdall/complete", async (
ILogger<HeimdallAuthService> logger,
CancellationToken cancellationToken) =>
{
// Every answer here sets or clears an attempt cookie or signs someone in: none may be stored.
httpContext.Response.Headers.CacheControl = "no-store";
var form = await ReadFormOrNullAsync(httpContext.Request, cancellationToken);
var attempt = form?["attempt"].ToString();
var held = heimdallAuthService.FindAttemptCookie(httpContext.Request.Cookies, attempt);