2023-05-02 16:50:44 +03:00
|
|
|
import { useEffect } from "react";
|
2023-04-20 20:51:46 +02:00
|
|
|
import type { PageProps } from "keycloakify/login/pages/PageProps";
|
|
|
|
import type { KcContext } from "../kcContext";
|
|
|
|
import type { I18n } from "../i18n";
|
|
|
|
|
|
|
|
export default function SamlPostForm(props: PageProps<Extract<KcContext, { pageId: "saml-post-form.ftl" }>, I18n>) {
|
|
|
|
const { kcContext, i18n, doUseDefaultCss, Template, classes } = props;
|
|
|
|
|
|
|
|
const { msgStr, msg } = i18n;
|
|
|
|
|
|
|
|
const { samlPost } = kcContext;
|
2023-05-02 16:50:44 +03:00
|
|
|
useEffect(() => { document.forms[0].submit(); }, [samlPost]);
|
2023-04-20 20:51:46 +02:00
|
|
|
return (
|
|
|
|
<Template {...{ kcContext, i18n, doUseDefaultCss, classes }} displayMessage={false} headerNode={msg("saml.post-form.title")}>
|
|
|
|
<p>{msg("saml.post-form.message")}</p>
|
|
|
|
<form name="saml-post-binding" method="post" action={samlPost.url}>
|
|
|
|
{samlPost.SAMLRequest && <input type="hidden" name="SAMLRequest" value={samlPost.SAMLRequest} />}
|
|
|
|
{samlPost.SAMLResponse && <input type="hidden" name="SAMLResponse" value={samlPost.SAMLResponse} />}
|
2023-05-02 16:50:44 +03:00
|
|
|
{samlPost.relayState && <input type="hidden" name="RelayState" value={samlPost.relayState} />}
|
2023-04-20 20:51:46 +02:00
|
|
|
<noscript>
|
|
|
|
<p>{msg("saml.post-form.js-disabled")}</p>
|
|
|
|
<input type="submit" value={msgStr("doContinue")} />
|
|
|
|
</noscript>
|
|
|
|
</form>
|
|
|
|
</Template>
|
|
|
|
);
|
|
|
|
}
|