Call correct SAML key download API (#23375)

This commit is contained in:
Stan Silvert 2023-09-20 14:53:57 -04:00 committed by GitHub
parent b5a2b99874
commit 2463c6291d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 2 deletions

View file

@ -8,15 +8,18 @@ import { adminClient } from "../../admin-client";
import { useAlerts } from "../../components/alert/Alerts";
import { useRealm } from "../../context/realm-context/RealmContext";
import { KeyForm, getFileExtension } from "./GenerateKeyDialog";
import { KeyTypes } from "./SamlKeys";
type ExportSamlKeyDialogProps = {
clientId: string;
close: () => void;
keyType: KeyTypes;
};
export const ExportSamlKeyDialog = ({
clientId,
close,
keyType,
}: ExportSamlKeyDialogProps) => {
const { t } = useTranslation();
const { realm } = useRealm();
@ -32,7 +35,7 @@ export const ExportSamlKeyDialog = ({
const keyStore = await adminClient.clients.downloadKey(
{
id: clientId,
attr: "saml.signing",
attr: keyType,
},
config,
);

View file

@ -82,7 +82,11 @@ const KeySection = ({
return (
<>
{showImportDialog && (
<ExportSamlKeyDialog clientId={clientId} close={toggleImportDialog} />
<ExportSamlKeyDialog
keyType={attr}
clientId={clientId}
close={toggleImportDialog}
/>
)}
<FormPanel title={t(title)} className="kc-form-panel__panel">
<TextContent className="pf-u-pb-lg">