fix: saml attributes for form post

This commit is contained in:
Stefan Benz
2025-03-12 10:08:14 +01:00
parent b90a0c31c1
commit 9bbbd965ed

View File

@@ -477,17 +477,17 @@ export async function GET(request: NextRequest) {
} else if (url && binding.case === "post") {
// Create form data after SAML standard
const formData = {
"RelayState": binding.value.relayState,
"SAMLResponse": binding.value.samlResponse,
RelayState: binding.value.relayState,
SAMLResponse: binding.value.samlResponse,
};
// Convert form data to URL-encoded string
const formBody = Object.entries(formData)
.map(
([key, value]) =>
encodeURIComponent(key) + "=" + encodeURIComponent(value),
)
.join("&");
.map(
([key, value]) =>
encodeURIComponent(key) + "=" + encodeURIComponent(value),
)
.join("&");
// Make a POST request to the external URL with the form data
const response = await fetch(url, {