Merge pull request #391 from zitadel/fix-saml

fix(saml): requestId serializing
This commit is contained in:
Max Peintner
2025-03-13 08:50:08 +01:00
committed by GitHub

View File

@@ -81,9 +81,12 @@ export async function GET(request: NextRequest) {
// internal request id which combines authRequest and samlRequest with the prefix oidc_ or saml_
let requestId =
searchParams.get("requestId") ||
`oidc_${oidcRequestId}` ||
`saml_${samlRequestId}`;
searchParams.get("requestId") ??
(oidcRequestId
? `oidc_${oidcRequestId}`
: samlRequestId
? `saml_${samlRequestId}`
: undefined);
const sessionId = searchParams.get("sessionId");
@@ -470,9 +473,10 @@ export async function GET(request: NextRequest) {
if (url && binding.case === "redirect") {
return NextResponse.redirect(url);
} else if (url && binding.case === "post") {
// Create form data after SAML standard
const formData = {
key1: "value1",
key2: "value2",
RelayState: binding.value.relayState,
SAMLResponse: binding.value.samlResponse,
};
// Convert form data to URL-encoded string