theme.keycloak.v2.admin.resources.assets.AddOpenIdConnect-Cs8jn03U.js.map Maven / Gradle / Ivy
{"version":3,"file":"AddOpenIdConnect-Cs8jn03U.js","sources":["../../src/identity-providers/add/OpenIdConnectSettings.tsx","../../src/identity-providers/add/AddOpenIdConnect.tsx"],"sourcesContent":["import { FormGroup, Title } from \"@patternfly/react-core\";\nimport { useFormContext } from \"react-hook-form\";\nimport { useTranslation } from \"react-i18next\";\nimport { FormErrorText, HelpItem } from \"@keycloak/keycloak-ui-shared\";\nimport { useAdminClient } from \"../../admin-client\";\nimport { JsonFileUpload } from \"../../components/json-file-upload/JsonFileUpload\";\nimport { DiscoveryEndpointField } from \"../component/DiscoveryEndpointField\";\nimport { DiscoverySettings } from \"./DiscoverySettings\";\n\nexport const OpenIdConnectSettings = () => {\n const { adminClient } = useAdminClient();\n\n const { t } = useTranslation();\n const id = \"oidc\";\n\n const {\n setValue,\n setError,\n clearErrors,\n formState: { errors },\n } = useFormContext();\n\n const setupForm = (result: any) => {\n Object.keys(result).map((k) => setValue(`config.${k}`, result[k]));\n };\n\n const fileUpload = async (obj?: object) => {\n clearErrors(\"discoveryError\");\n if (!obj) {\n return;\n }\n\n const formData = new FormData();\n formData.append(\"providerId\", id);\n formData.append(\"file\", new Blob([JSON.stringify(obj)]));\n\n try {\n const result =\n await adminClient.identityProviders.importFromUrl(formData);\n setupForm(result);\n } catch (error) {\n setError(\"discoveryError\", {\n type: \"manual\",\n message: (error as Error).message,\n });\n }\n };\n\n return (\n <>\n \n {t(\"oidcSettings\")}\n \n\n \n }\n >\n fileUpload(value)}\n />\n {errors.discoveryError && (\n \n )}\n \n }\n >\n {(readonly) => }\n \n >\n );\n};\n","import type IdentityProviderRepresentation from \"@keycloak/keycloak-admin-client/lib/defs/identityProviderRepresentation\";\nimport {\n ActionGroup,\n AlertVariant,\n Button,\n PageSection,\n} from \"@patternfly/react-core\";\nimport { FormProvider, useForm } from \"react-hook-form\";\nimport { useTranslation } from \"react-i18next\";\nimport { Link, useLocation, useNavigate } from \"react-router-dom\";\nimport { useAdminClient } from \"../../admin-client\";\nimport { useAlerts } from \"../../components/alert/Alerts\";\nimport { FormAccess } from \"../../components/form/FormAccess\";\nimport { ViewHeader } from \"../../components/view-header/ViewHeader\";\nimport { useRealm } from \"../../context/realm-context/RealmContext\";\nimport { toIdentityProvider } from \"../routes/IdentityProvider\";\nimport { toIdentityProviders } from \"../routes/IdentityProviders\";\nimport { OIDCAuthentication } from \"./OIDCAuthentication\";\nimport { OIDCGeneralSettings } from \"./OIDCGeneralSettings\";\nimport { OpenIdConnectSettings } from \"./OpenIdConnectSettings\";\n\ntype DiscoveryIdentity = IdentityProviderRepresentation & {\n discoveryEndpoint?: string;\n};\n\nexport default function AddOpenIdConnect() {\n const { adminClient } = useAdminClient();\n\n const { t } = useTranslation();\n const navigate = useNavigate();\n const { pathname } = useLocation();\n const isKeycloak = pathname.includes(\"keycloak-oidc\");\n const id = `${isKeycloak ? \"keycloak-\" : \"\"}oidc`;\n\n const form = useForm({\n defaultValues: { alias: id },\n mode: \"onChange\",\n });\n const {\n handleSubmit,\n formState: { isDirty },\n } = form;\n\n const { addAlert, addError } = useAlerts();\n const { realm } = useRealm();\n\n const onSubmit = async (provider: DiscoveryIdentity) => {\n delete provider.discoveryEndpoint;\n try {\n await adminClient.identityProviders.create({\n ...provider,\n providerId: id,\n });\n addAlert(t(\"createIdentityProviderSuccess\"), AlertVariant.success);\n navigate(\n toIdentityProvider({\n realm,\n providerId: id,\n alias: provider.alias!,\n tab: \"settings\",\n }),\n );\n } catch (error) {\n addError(\"createIdentityProviderError\", error);\n }\n };\n\n return (\n <>\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n >\n );\n}\n"],"names":["OpenIdConnectSettings","adminClient","useAdminClient","useTranslation","id","setValue","setError","clearErrors","errors","useFormContext","setupForm","result","k","fileUpload","obj","formData","error","jsxs","Fragment","jsx","Title","DiscoveryEndpointField","FormGroup","HelpItem","JsonFileUpload","value","FormErrorText","readonly","DiscoverySettings","AddOpenIdConnect","navigate","useNavigate","pathname","useLocation","isKeycloak","form","useForm","handleSubmit","isDirty","addAlert","addError","useAlerts","realm","useRealm","onSubmit","provider","AlertVariant","toIdentityProvider","ViewHeader","PageSection","FormProvider","FormAccess","OIDCGeneralSettings","OIDCAuthentication","ActionGroup","Button","props","Link","toIdentityProviders"],"mappings":"86BASO,MAAMA,EAAwB,IAAM,CACnC,KAAA,CAAE,YAAAC,GAAgBC,IAElB,CAAE,GAAMC,IACRC,EAAK,OAEL,CACJ,SAAAC,EACA,SAAAC,EACA,YAAAC,EACA,UAAW,CAAE,OAAAC,CAAO,GAClBC,EAAe,EAEbC,EAAaC,GAAgB,CACjC,OAAO,KAAKA,CAAM,EAAE,IAAKC,GAAMP,EAAS,UAAUO,CAAC,GAAID,EAAOC,CAAC,CAAC,CAAC,CAAA,EAG7DC,EAAa,MAAOC,GAAiB,CAEzC,GADAP,EAAY,gBAAgB,EACxB,CAACO,EACH,OAGI,MAAAC,EAAW,IAAI,SACZA,EAAA,OAAO,aAAcX,CAAE,EACvBW,EAAA,OAAO,OAAQ,IAAI,KAAK,CAAC,KAAK,UAAUD,CAAG,CAAC,CAAC,CAAC,EAEnD,GAAA,CACF,MAAMH,EACJ,MAAMV,EAAY,kBAAkB,cAAcc,CAAQ,EAC5DL,EAAUC,CAAM,QACTK,EAAO,CACdV,EAAS,iBAAkB,CACzB,KAAM,SACN,QAAUU,EAAgB,OAAA,CAC3B,CACH,CAAA,EAGF,OAEIC,EAAAC,EAAA,CAAA,SAAA,CAACC,EAAAC,EAAA,CAAM,aAAa,KAAK,KAAK,KAAK,UAAU,uBAC1C,SAAE,EAAA,cAAc,CACnB,CAAA,EAEAD,EAACE,EAAA,CACC,GAAG,OACH,WACEJ,EAACK,EAAA,CACC,MAAO,EAAE,cAAc,EACvB,QAAQ,mBACR,UACEH,EAACI,EAAA,CACC,SAAU,EAAE,kBAAkB,EAC9B,aAAa,cAAA,CACf,EAGF,SAAA,CAAAJ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