fix(sso): read SAML InResponseTo from correct path (#8607)

samlify's extractor nests InResponseTo under `extract.response`, not
directly on `extract`. The two login handlers (callbackSSOSAML and
acsEndpoint) were reading `extract.inResponseTo` which is always
undefined, causing InResponseTo validation to always fail. The logout
handler already used the correct path `extract?.response?.inResponseTo`.

Updated SAMLAssertionExtract interface to include the `response` property
with proper typing instead of casting to `any`.
This commit is contained in:
Alex Yang
2026-03-16 20:02:54 -07:00
parent bbe1affa40
commit 2ac8e5d312
2 changed files with 7 additions and 7 deletions
+4 -6
View File
@@ -2173,9 +2173,8 @@ export const callbackSSOSAML = (options?: SSOOptions) => {
logger: ctx.context.logger,
});
const inResponseTo = (extract as SAMLAssertionExtract).inResponseTo as
| string
| undefined;
const inResponseTo = (extract as SAMLAssertionExtract).response
?.inResponseTo;
const shouldValidateInResponseTo =
options?.saml?.enableInResponseToValidation;
@@ -2689,9 +2688,8 @@ export const acsEndpoint = (options?: SSOOptions) => {
logger: ctx.context.logger,
});
const inResponseToAcs = (extract as SAMLAssertionExtract).inResponseTo as
| string
| undefined;
const inResponseToAcs = (extract as SAMLAssertionExtract).response
?.inResponseTo;
const shouldValidateInResponseToAcs =
options?.saml?.enableInResponseToValidation;
+3 -1
View File
@@ -99,11 +99,13 @@ export interface SAMLSessionRecord {
export interface SAMLAssertionExtract {
nameID?: string;
sessionIndex?: string;
inResponseTo?: string;
conditions?: {
notBefore?: string;
notOnOrAfter?: string;
};
response?: {
inResponseTo?: string;
};
}
type BaseSSOProvider = {