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

@@ -197,6 +197,10 @@ func NewServer(cfg Config) (*Server, error) {
_, err := cfg.Trust.GetByDomainName(ctx, host)
return err == nil
},
func(ctx context.Context, host string) bool {
_, err := cfg.Trust.GetByDomainName(ctx, host)
return err == nil
},
),
}, nil
}