Skip to content

fix(sso): honour sso_custom_domain_redirect_enabled in /sso/config - #849

Open
libingtong wants to merge 1 commit into
dataelement:mainfrom
libingtong:fix/sso-config-honors-custom-domain-setting
Open

fix(sso): honour sso_custom_domain_redirect_enabled in /sso/config#849
libingtong wants to merge 1 commit into
dataelement:mainfrom
libingtong:fix/sso-config-honors-custom-domain-setting

Conversation

@libingtong

Copy link
Copy Markdown

get_sso_config() calls get_tenant_sso_base_url() without passing sso_redirect_enabled, so the parameter defaults to True and the sso_custom_domain_redirect_enabled platform setting is ignored on this path.

The method's own docstring states the caller should pre-resolve the flag via system_setting_dao.is_sso_custom_domain_redirect_enabled(), and app/api/auth.py already does exactly that — /sso/config is inconsistent with it.

Impact

For single-domain deployments (one host serving the platform, admin has turned the setting off), get_tenant_sso_base_url() falls through to the tenant-subdomain branch and rewrites app.example.com into {tenant.slug}.example.com. Every SSO button on the login page then points at a host that does not exist, and turning the setting off has no effect because this call site never reads it.

This PR

Resolves the flag the same way auth.py does and passes it through. One call site, no behaviour change for deployments that leave the setting enabled.

get_sso_config() calls get_tenant_sso_base_url() without passing
sso_redirect_enabled, so the parameter defaults to True and the
`sso_custom_domain_redirect_enabled` platform setting is ignored on this path.

The method's own docstring states the caller should pre-resolve the flag via
system_setting_dao.is_sso_custom_domain_redirect_enabled(), and app/api/auth.py
already does exactly that — /sso/config is inconsistent with it.

Impact for single-domain deployments (one host serving the platform, admin has
turned the setting off): get_tenant_sso_base_url() falls through to the tenant
subdomain branch and rewrites `app.example.com` into
`{tenant.slug}.example.com`, so every SSO button on the login page points at a
host that does not exist. Turning the setting off has no effect because this
call site never reads it.

Resolve the flag the same way auth.py does and pass it through.
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