Desktop OIDC: open system browser, capture callback on localhost
Some checks failed
ci / build-test (push) Has been cancelled
ci / docker-build (push) Has been cancelled
Desktop App / Build Linux (amd64) (push) Has been cancelled
Desktop App / Attach to Release (push) Has been cancelled

ConfigService.StartOIDCLogin():
- Fetches OIDC config from the API
- Generates PKCE params
- Starts local HTTP server on 127.0.0.1:18901
- Opens system browser to Authentik
- Captures callback directly (no copy-paste)
- Exchanges code for token, saves to keychain
- Returns token to SPA → auto-connects

Config.svelte detects Wails environment and calls the binding.
This commit is contained in:
2026-07-13 23:37:17 +02:00
parent 5699a3f758
commit c31978042f
2 changed files with 187 additions and 4 deletions

View File

@@ -67,6 +67,24 @@
error = ''
oidcLoggingIn = true
setConfig({ apiUrl: apiUrl.trim(), token: '' })
const wails = (window as any).wails
if (wails?.Call?.ByName) {
try {
const token = await wails.Call.ByName('StartOIDCLogin', apiUrl.trim())
if (token) {
setConfig({ apiUrl: apiUrl.trim(), token })
initConfig({ apiUrl: apiUrl.trim(), token })
onConnected()
return
}
} catch (e: any) {
error = e?.message || e || 'OIDC login failed'
oidcLoggingIn = false
return
}
}
try {
await startLogin()
} catch (e: any) {