All Downloads are FREE. Search and download functionalities are using the official Maven repository.

theme.keycloak.v2.admin.resources.assets.UserFederationKerberosSettings-CeA77ZYv.js Maven / Gradle / Ivy

There is a newer version: 26.0.7
Show newest version
import{jsxs as c,jsx as a}from"react/jsx-runtime";import{a as k,c as P,ab as F,F as S,y as p,ac as g,ad as h,ae as m,a4 as f,v as I,u as A,g as C,d as H,f as T,w as N,P as v,r as q,A as L,i as w,dY as R,k as D}from"./main-C7ps2lmX.js";import{u as E}from"./useParams-B67lSY02.js";import{useEffect as V}from"react";import{F as x}from"./FormAccess-DyLNkc18.js";import{W as O,H as U,S as K}from"./SettingsCache-BECJJhg-.js";import{i as _}from"./isEqual-BWOcMitS.js";import"react-dom";import"./copy-icon-ACZmDH8e.js";import"./ConfirmDialog-hx7XKLbN.js";import"./ViewHeader-B7eeFzFA.js";import"./useToggle-K3Kx99tM.js";const Y=({form:r,showSectionHeading:s=!1,showSectionDescription:i=!1})=>{const{t:e}=k(),{realm:u,realmRepresentation:l}=P(),b=F({control:r.control,name:"config.allowPasswordAuthentication"});return V(()=>r.setValue("parentId",l?.id),[]),c(S,{...r,children:[s&&a(O,{title:e("requiredSettings"),description:e("kerberosRequiredSettingsDescription"),showDescription:i}),c(x,{role:"manage-realm",isHorizontal:!0,children:[a("input",{type:"hidden",defaultValue:"kerberos",...r.register("providerId")}),a("input",{type:"hidden",defaultValue:"org.keycloak.storage.UserStorageProvider",...r.register("providerType")}),a("input",{type:"hidden",defaultValue:u,...r.register("parentId")}),a(p,{name:"name",label:e("uiDisplayName"),labelIcon:e("uiDisplayNameHelp"),rules:{required:e("validateName")}}),a(p,{name:"config.kerberosRealm.0",label:e("kerberosRealm"),labelIcon:e("kerberosRealmHelp"),rules:{required:e("validateRealm")}}),a(p,{name:"config.serverPrincipal.0",label:e("serverPrincipal"),labelIcon:e("serverPrincipalHelp"),rules:{required:e("validateServerPrincipal")}}),a(p,{name:"config.keyTab.0",label:e("keyTab"),labelIcon:e("keyTabHelp"),rules:{required:e("validateKeyTab")}}),a(g,{label:e("debug"),labelIcon:a(h,{helpText:e("debugHelp"),fieldLabelId:"debug"}),fieldId:"kc-debug",hasNoPaddingTop:!0,children:a(m,{name:"config.debug",defaultValue:["false"],control:r.control,render:({field:t})=>a(f,{id:"kc-debug","data-testid":"debug",onChange:(d,o)=>t.onChange([`${o}`]),isChecked:t.value?.[0]==="true",label:e("on"),labelOff:e("off"),"aria-label":e("debug")})})}),a(g,{label:e("allowPasswordAuthentication"),labelIcon:a(h,{helpText:e("allowPasswordAuthenticationHelp"),fieldLabelId:"allowPasswordAuthentication"}),fieldId:"kc-allow-password-authentication",hasNoPaddingTop:!0,children:a(m,{name:"config.allowPasswordAuthentication",defaultValue:["false"],control:r.control,render:({field:t})=>a(f,{id:"kc-allow-password-authentication","data-testid":"allow-password-authentication",onChange:(d,o)=>t.onChange([`${o}`]),isChecked:t.value?.[0]==="true",label:e("on"),labelOff:e("off"),"aria-label":e("allowPasswordAuthentication")})})}),_(b,["true"])?a(I,{name:"config.editMode[0]",label:e("editMode"),labelIcon:e("editModeKerberosHelp"),controller:{rules:{required:e("required")},defaultValue:"READ_ONLY"},options:["READ_ONLY","UNSYNCED"]}):null,a(g,{label:e("updateFirstLogin"),labelIcon:a(h,{helpText:e("updateFirstLoginHelp"),fieldLabelId:"updateFirstLogin"}),fieldId:"kc-update-first-login",hasNoPaddingTop:!0,children:a(m,{name:"config.updateProfileFirstLogin",defaultValue:["false"],control:r.control,render:({field:t})=>a(f,{id:"kc-update-first-login","data-testid":"update-first-login",onChange:(d,o)=>t.onChange([`${o}`]),isChecked:t.value?.[0]==="true",label:e("on"),labelOff:e("off"),"aria-label":e("updateFirstLogin")})})})]})]})};function ae(){const{adminClient:r}=A(),{t:s}=k(),i=C({mode:"onChange"}),e=H(),{realm:u}=P(),{id:l}=E(),{addAlert:b,addError:t}=T();N(async()=>{if(l)return r.components.findOne({id:l})},n=>{if(n)d(n);else if(l)throw new Error(s("notFound"))},[]);const d=n=>{i.reset({...n})},o=async n=>{try{l?await r.components.update({id:l},n):(await r.components.create(n),e(`/${u}/user-federation`)),d(n),b(s(l?"userProviderSaveSuccess":"createUserProviderSuccess"),D.success)}catch(y){t(l?"userProviderSaveError":"createUserProviderError",y)}};return c(S,{...i,children:[a(U,{provider:"Kerberos",save:()=>i.handleSubmit(o)()}),a(v,{variant:"light",children:a(Y,{form:i,showSectionHeading:!0})}),c(v,{variant:"light",isFilled:!0,children:[a(K,{form:i,showSectionHeading:!0}),a(q,{onSubmit:i.handleSubmit(o),children:c(L,{children:[a(w,{isDisabled:!i.formState.isDirty,variant:"primary",type:"submit","data-testid":"kerberos-save",children:s("save")}),a(w,{variant:"link",onClick:()=>e(R({realm:u})),"data-testid":"kerberos-cancel",children:s("cancel")})]})})]})]})}export{ae as default};
//# sourceMappingURL=UserFederationKerberosSettings-CeA77ZYv.js.map




© 2015 - 2025 Weber Informatics LLC | Privacy Policy