generated from eblume/project-template
heph-pwa: Login with Authentik (Authorization Code + PKCE) #9
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "heph-pwa-oidc-login"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Replaces the manual bearer-token paste in heph-pwa with a proper browser OIDC sign-in.
Hub (Rust)
GET /config->{issuer, client_id}, added after the auth layer so the app can read it before it has a token. Sourced from a newTokenVerifier::oidc_config(). Returns{}when the hub runs without OIDC. Covered byweb_serve.rstests.PWA (vanilla JS)
src/oauth.js— Authorization Code + PKCE (S256): discovery, authorize redirect, callback code->token exchange, and silent refresh (offline_access)./config); the manual token field stays under an "Or paste a bearer token" disclosure for OIDC-less hubs.rpc.jsretries once on 401 through a refresh hook;app.jscompletes the callback / refreshes on load;sw.jsskips caching the?code=...callback URL and shipsoauth.jsin the shell.Requires (blumeops)
The PWA origin must be a registered redirect URI on the Authentik
hephprovider (redirect_urisis currently[]). Addhttps://heph.ops.eblu.me/(+http://localhost:8787/for dev). Authentik also keys token-endpoint CORS off those origins.Tested
cargo clippyclean;cargo test -p hephdgreen (incl. 2 new/configtests); PWA parser tests pass; JS syntax-checked. Full browser login verified after the redirect URIs land and a hub build is deployed.🤖 Generated with Claude Code
Replace the manual bearer-token paste with a proper browser OIDC sign-in. - Hub: unauthenticated GET /config -> {issuer, client_id} (added after the auth layer), sourced from the verifier's new TokenVerifier::oidc_config(). Lets the PWA self-configure when served from the hub. Tests in web_serve.rs. - PWA: src/oauth.js implements PKCE (S256), the authorize redirect, the callback token exchange, and silent refresh (offline_access). Settings gains a "Login with Authentik" button (manual token kept under a fallback disclosure); rpc.js retries once on 401 via a refresh hook; app.js completes the callback / refreshes on load; sw.js skips caching the callback URL and ships oauth.js in the shell. Requires the PWA origin registered as a redirect URI on the Authentik provider. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>