Add session transfer for SSO cookies on custom domains

After OIDC login, if the redirect targets a trust center custom
domain, the callback now redirects through a session-transfer
endpoint on that domain. The endpoint verifies an HMAC-signed,
time-limited token and sets the session cookie on the custom
domain before redirecting to the final URL.

The continue URL is bound into the signed token payload to
prevent open-redirect attacks via parameter tampering.

Signed-off-by: Bryan Frimin <bryan@getprobo.com>
This commit is contained in:
Bryan Frimin
2026-03-31 14:21:20 +02:00
parent 5d6d0bdd7f
commit 84a35c90e9
7 changed files with 344 additions and 10 deletions

View File

@@ -63,6 +63,7 @@ func NewMux(
tokenSecret string,
baseURL *baseurl.BaseURL,
allowedRedirectHost saferedirect.AllowedHostFunc,
isTrustCenterDomain IsTrustCenterDomainFunc,
) *chi.Mux {
r := chi.NewMux()
@@ -74,7 +75,7 @@ func NewMux(
router := r.With(sessionMiddleware, apiKeyMiddleware)
oidcHandler := NewOIDCHandler(svc, cookieConfig, logger, allowedRedirectHost)
oidcHandler := NewOIDCHandler(svc, cookieConfig, logger, allowedRedirectHost, isTrustCenterDomain)
router.Handle("/graphql", graphqlHandler)
router.Get("/saml/2.0/metadata", samlHandler.MetadataHandler)