Skip to content

fix: generate SSO login return URL based on request host#1661

Merged
Eugeny merged 1 commit intowarp-tech:mainfrom
joseluisgonzalezca:fix-sso-return-url-domain-binding
Jan 12, 2026
Merged

fix: generate SSO login return URL based on request host#1661
Eugeny merged 1 commit intowarp-tech:mainfrom
joseluisgonzalezca:fix-sso-return-url-domain-binding

Conversation

@joseluisgonzalezca
Copy link
Copy Markdown
Contributor

This change modifies how the SSO return URL is generated during the login process so that it takes into account the incoming request and its specific host.

By doing this, we could reach a possible solution to support multiple independent HTTP sessions without interfering with the original behavior that enables cookie sharing across domains (see #1553, #1626 and comment #1626 (comment)).

Additionally, this approach appears to be the correct one, since during the SSO logout process the return URL construction already takes the request into account.

async fn api_start_slo(
&self,
req: &Request,
session: &Session,
services: Data<&Services>,
session_middleware: Data<&Arc<Mutex<SessionStore>>>,
) -> Result<StartSloResponse, WarpgateError> {
let Some(state) = session.get_sso_login_state() else {
return Ok(StartSloResponse::NotInSsoSession);
};
let config = services.config.lock().await;
let return_url = config.construct_external_url(Some(req), None)?;
debug!("Return URL: {}", &return_url);

I’m open to feedback and discussion on whether this is the most appropriate solution, and I’m happy to adapt the implementation if a better approach is suggested.

@Eugeny
Copy link
Copy Markdown
Member

Eugeny commented Jan 12, 2026

Looks like I've missed it originally - that's the way it's supposed to work, thanks!

@Eugeny Eugeny merged commit 14f0611 into warp-tech:main Jan 12, 2026
14 checks passed
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.

2 participants