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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user