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

View file

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