fleet/server/sso
Magnus Jensen 98cad56716
redirect to correct URL, and allow both URLs for MDM SSO SAML validation if set (#44156)
<!-- Add the related story/sub-task/bug number, like Resolves #123, or
remove if NA -->
**Related issue:** Resolves #41592 

# Checklist for submitter

If some of the following don't apply, delete the relevant line.

- [x] Changes file added for user-visible changes in `changes/`,
`orbit/changes/` or `ee/fleetd-chrome/changes`.
See [Changes
files](https://github.com/fleetdm/fleet/blob/main/docs/Contributing/guides/committing-changes.md#changes-files)
for more information.

- [x] Input data is properly validated, `SELECT *` is avoided, SQL
injection is prevented (using placeholders for values in statements), JS
inline code is prevented especially for url redirects, and untrusted
data interpolated into shell scripts/commands is validated against shell
metacharacters.
- [x] Timeouts are implemented and retries are limited to avoid infinite
loops
- [x] If paths of existing endpoints are modified without backwards
compatibility, checked the frontend/CLI for any necessary changes

## Testing

- [x] Added/updated automated tests
- [x] QA'd all new/changed functionality manually

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **Bug Fixes**
* Fixed SSO failures when a custom Apple MDM URL is configured: callback
requests are now redirected to the configured MDM URL when needed, and
SAML validation correctly considers the configured MDM/server URLs so
authentication succeeds for custom MDM setups.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-04-29 08:43:58 -06:00
..
testdata Replace home-made SAML implementation with https://github.com/crewjam/saml (#28486) 2025-07-07 15:13:46 -03:00
authorization_request.go End-user authentication for Window/Linux setup experience: backend (#34835) 2025-10-31 11:16:42 -05:00
authorization_request_test.go End-user authentication for Window/Linux setup experience: backend (#34835) 2025-10-31 11:16:42 -05:00
authorization_response.go Replace home-made SAML implementation with https://github.com/crewjam/saml (#28486) 2025-07-07 15:13:46 -03:00
authorization_response_test.go Replace home-made SAML implementation with https://github.com/crewjam/saml (#28486) 2025-07-07 15:13:46 -03:00
saml_provider.go redirect to correct URL, and allow both URLs for MDM SSO SAML validation if set (#44156) 2026-04-29 08:43:58 -06:00
session_store.go End-user authentication for Window/Linux setup experience: backend (#34835) 2025-10-31 11:16:42 -05:00
session_store_test.go End-user authentication for Window/Linux setup experience: backend (#34835) 2025-10-31 11:16:42 -05:00
settings.go Replace home-made SAML implementation with https://github.com/crewjam/saml (#28486) 2025-07-07 15:13:46 -03:00
settings_test.go Replace home-made SAML implementation with https://github.com/crewjam/saml (#28486) 2025-07-07 15:13:46 -03:00
validate_test.go Replace home-made SAML implementation with https://github.com/crewjam/saml (#28486) 2025-07-07 15:13:46 -03:00