Skip to content

Visualiser: PKCE login on plain-http deployments#686

Merged
AlexGodbehere merged 1 commit into
mainfrom
ag/visualiser-insecure-context
Jul 21, 2026
Merged

Visualiser: PKCE login on plain-http deployments#686
AlexGodbehere merged 1 commit into
mainfrom
ag/visualiser-insecure-context

Conversation

@AlexGodbehere

Copy link
Copy Markdown
Contributor

Summary

On http-only clusters (e.g. FPD/ago) crypto.subtle is undefined (secure contexts only), so the OIDC login introduced in #685 threw Cannot read properties of undefined (reading 'digest') in start_code_flow before ever redirecting to Keycloak.

Add a pure-JS SHA-256 fallback for the PKCE code challenge, used only when crypto.subtle is absent. The implementation is fuzz-tested byte-for-byte against node:crypto (516 vectors including block-boundary lengths).

How to test

  1. Deploy to an http-only cluster and open the visualiser: you should now reach the Keycloak login page and complete login.
  2. On an https cluster, behaviour is unchanged (native crypto.subtle path).

🤖 Generated with Claude Code

crypto.subtle only exists in secure contexts, and several ACS
deployments serve the visualiser over plain http (kiosk displays on
closed networks especially), where login died before redirecting.
Fall back to a pure-JS FIPS 180-4 SHA-256 for the PKCE challenge;
verified byte-for-byte against node:crypto across block boundaries.
@AlexGodbehere
AlexGodbehere merged commit 673f2a3 into main Jul 21, 2026
1 check passed
@AlexGodbehere
AlexGodbehere deleted the ag/visualiser-insecure-context branch July 21, 2026 12:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant