Skip to content

Feature: Browser-based (SSO) authentication + session keep-alive#77

Open
cwbr wants to merge 5 commits intooisee:mainfrom
cwbr:feature/browser-based-sso
Open

Feature: Browser-based (SSO) authentication + session keep-alive#77
cwbr wants to merge 5 commits intooisee:mainfrom
cwbr:feature/browser-based-sso

Conversation

@cwbr
Copy link
Copy Markdown

@cwbr cwbr commented Mar 27, 2026

Summary

Adds browser-based SSO authentication (Kerberos, SAML, Keycloak) and automatic session keep-alive to prevent idle timeouts — especially useful for cookie/browser-auth sessions.

Browser-Based SSO Authentication

Opens a Chromium browser for SSO login, captures session cookies, and passes them to the ADT client. Supports SAML, Kerberos, Keycloak, and form-based login flows.

New files:

  • browser_auth.go — Browser login via chromedp (312 lines)
  • browser_auth_test.go — Unit tests (100 lines)

New CLI flags:

Flag Env Variable Description
--browser-auth SAP_BROWSER_AUTH Open browser for SSO login
--browser-auth-timeout SAP_BROWSER_AUTH_TIMEOUT SSO login timeout (default: 120s)
--browser-exec SAP_BROWSER_EXEC Path to Chromium browser (default: auto-detect)
--cookie-save SAP_COOKIE_SAVE Save cookies to file for reuse with --cookie-file

Usage:

vsp --url https://host:44300 --browser-auth
vsp --url https://host:44300 --browser-auth --cookie-save cookies.txt

Session Keep-Alive

Background goroutine sends periodic HEAD requests to /sap/bc/adt/core/discovery to keep the SAP session alive during idle periods. Refreshes the CSRF token as side effect.

Flag Env Variable Default Description
--keepalive SAP_KEEPALIVE 5m Keep-alive interval (0 to disable)

Changed files:

  • http.go — Added Ping() method on Transport
  • client.go — Added StartKeepAlive()/StopKeepAlive() with goroutine lifecycle management
  • server.go — KeepAliveInterval config field, auto-start in NewServer()
  • main.go — CLI flag, env var binding, verbose logging

Documentation

Updated configuration tables in README.md and CLAUDE.md with all new flags.

Dependencies

Added github.com/chromedp/chromedp + github.com/chromedp/cdproto for headless browser control.

@cwbr
Copy link
Copy Markdown
Author

cwbr commented Mar 27, 2026

Solves #30

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