Repository navigation
Fix SAML callback blank redirect response - #93
Merged
LeoStehlik merged 1 commit intoSep 14, 2026
Merged
Conversation
Signed-off-by: Leo Stehlik <[email protected]>
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
SkipTransformso the global response interceptor cannot wrap redirect outputRoot Cause
PR #92 returned Nest
@Redirect()descriptors like{ url, statusCode }from callbacks. Its test booted Fastify with the/apiprefix and cookie plugin, but did not register the productionTransformHttpResponseInterceptorfrommain.ts.In production, that interceptor wrapped the descriptor under
data, so Nest's redirect handler no longer saw a top-levelurlorstatusCode. A local production-interceptor probe againstmasterreproduced this as302, emptyLocation, auth cookie present, and zero-byte body for both SAML callback routes. That explains why the browser can stay on a blank callback after a successful-looking login and why PR #92 passed locally.Fix
The callbacks now issue the terminal response directly: status
303,Location, auth cookie,send(). The response is not a JSON API payload, so the callbacks explicitly skip the global transform.Verification Run
pnpm --filter ./apps/server test -- sso --runInBand: 3 suites, 22 tests passedpnpm --filter ./apps/server exec jest --runInBand: 27 suites, 156 tests passedpnpm --filter ./apps/server build: passedgit diff --check: passed303, non-emptyLocation,Set-Cookiepresent, zero-byte bodyLive-Safe Post-Deploy Checks
Do not print
SAMLResponse, cookies, JWTs, certificates, or claims. For the deployed container, confirm source and compiled artifact with read-only commands such as:For one fresh incognito SP-initiated login, capture only safe callback metadata: timestamp/path, HTTP status, whether
Locationis present and same-origin, whetherSet-Cookieis present without value, content type, byte count, app log outcome, and whether the Redis request key was consumed. Expected successful callback:303,Locationto app URL,Set-Cookiepresent, zero-byte body.Security
SAML validation is unchanged:
validateInResponseToremainsifPresent, Redis request ID TTL/consumption remains in place, and response/assertion signature requirements remain enabled.