Call correct SAML key download API (#23375)
This commit is contained in:
parent
b5a2b99874
commit
2463c6291d
2 changed files with 9 additions and 2 deletions
|
@ -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,
|
||||||
);
|
);
|
||||||
|
|
|
@ -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">
|
||||||
|
|
Loading…
Reference in a new issue