minute: replace basic auth with magic-link + cookie#225
Merged
Conversation
Browsers (especially corporate-managed Chromium) increasingly suppress the basic-auth dialog and strip URL-embedded credentials, leaving users unable to open Minute even with the LoginUrl in hand. The CloudFront Function now mints a token at deploy time, accepts it via ?key= on the LoginUrl, sets a 7-day HttpOnly cookie via 302, and validates the cookie on subsequent requests. Works with fetch(), no dialog, no embedded creds. The 401 page deep-links back to the stack's CloudFormation Outputs tab so a lost user can self-recover. Outputs reshaped: MinuteLoginUrl now ?key=<token>, MinuteAuthToken added, BasicAuthUsername/BasicAuthPassword removed. Walkthrough steps 1 and 2, index landing, and screenshot YAML updated to the single-link flow. Also sets generateBootstrapVersionRule: false on the synthesizer; ISB pool accounts have no CDK bootstrap, so the rule was blocking change-set creation on out-of-band updates.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
MinuteLoginUrl(ends in?key=<token>), CloudFront sets a 7-day cookie and 302s to the clean URL. Subsequent requests authenticate via the cookie, sofetch()works and no browser dialog is required.https://user:pass@host), so the previousMinuteLoginUrlwas also unusable for them.MinuteLoginUrlis nowhttps://<domain>/?key=<token>,MinuteAuthTokenadded for support/diagnostics,BasicAuthUsername/BasicAuthPasswordremoved. Walkthrough (steps 1, 2, index, screenshot YAML) rewritten to the single-link flow.generateBootstrapVersionRule: falseon the synthesizer. ISB pool accounts have no CDK bootstrap, and the missing flag was blocking out-of-band change-set creation on existing StackSet instances.Live-deployed via change set to account
970659054265to unblock the reporting user. Hub StackSet still ships the old template, so this PR is what makes the fix permanent across future deploys.Closes issue #11 in the Minute scenario lessons (basic auth breaks
fetch()and modern browsers).Test plan
npx tsc --noEmitpassesnpx cdk synthproduces clean template;Fn::Subcorrectly substitutesToken,StackName,StackOutputsUrlBasicAuth*references anywhere incloudformation/scenarios/minute/orsrc/walkthroughs/minute/orsrc/_data/970659054265after change-set apply:?key=<token>returns 302 withSet-Cookie: ndx-minute-auth=...; Max-Age=604800; Secure; HttpOnly; SameSite=Lax; Path=/?key=returns 401deploy-blueprints.ymlso the hub StackSet ships the new templatesrc/assets/images/walkthroughs/minute/screenshots/cloudformation-outputs-desktop.pngagainst a fresh deploy showing the new output names