PageSourceSearch

https://id.prepuptime.com/resources/ir6j6/admin/keycloak.v2/assets/AuthenticationSection-CTMjSoJ4.js

js prepuptime.com collected 2026-09-24 14:50:31 UTC 22,922 bytes, 2 lines download raw bytes

1import{jsx as e,jsxs as b,Fragment as R}from"react/jsx-runtime";import{u as E,a as C,B as D,n as L,m as ae,M as we,o as ve,F as Me,p as U,A as K,g as w,f as O,q as ne,r as ie,s as x,d as _,v as le,S as Q,w as se,x as Ie,z as Ce,C as Se,E as J,G as Te,H as Ve,J as Re,K as Z,N as $e,I as Ee,P as V,$ as j,O as Y,Q as Le,R as q,_ as M,U as ee,V as ce,W as de,X as Ue,Y as Ke,Z as _e,a0 as Be,a1 as Ge,a2 as ue,a3 as je,a4 as me,a5 as Ye,a6 as ze,a7 as We,e as ke,a8 as Xe,a9 as Qe,T as Ne,aa as Je,ab as Ze,ac as et,ad as tt,ae as at,af as nt,ag as it,ah as lt,ai as ot,aj as rt,ak as st,al as ct,am as dt,an as ut,ao as pe,L as xe,ap as mt,y as pt,aq as ht,ar as bt}from"./main-_ihRb8Qg.js";import{useState as T,useEffect as oe,useMemo as Oe}from"react";import{u as yt}from"./ConfirmDialog-C_CyRe0B.js";import{R as ft,u as At}from"./RoutableTabs-DhXzPJJE.js";import{V as gt}from"./ViewHeader-BKbUCfZV.js";import{u as De,m as Pt}from"./useLocaleSort-CDjIXEHs.js";import{C as wt,R as vt,D as It,B as Ct}from"./DuplicateFlowModal-B_OzAeZT.js";import{D as St}from"./DraggableTable-SUJv3KIK.js";import{D as Tt}from"./DynamicComponents-BaJRoKWf.js";import{T as Rt}from"./trash-icon-BcDA4ldw.js";import{f as Et}from"./AddRoleMappingModal-CyI9hBlp.js";import{F as z}from"./FormAccess-nKSssynu.js";import{T as He}from"./TimeSelectorControl-DIbLTOPM.js";import{M as he}
1from"./MultiLineInput-CsIbzFmn.js";import{Q as _t}from"./question-circle-icon-CKWfXz4g.js";import{T as kt,a as k,b as N}from"./Tabs-CrFbOwgg.js";import{T as Nt}from"./Trans-Cy4VrRAr.js";import{s as xt}from"./sortBy-ByqSEyPO.js";import"react-dom";import"./PageHandler-m6Hyx9jP.js";import"./useParams-CZh4xVl7.js";import"./constants-BclHbWtx.js";import"./NameDescription-DC59-r-a.js";import"./DataListItemRow-Dy_s8uJK.js";import"./ClientSelect-B1O_K1Bm.js";import"./FileUpload-CsLjB0m6.js";import"./GroupPickerDialog-Re0MvBrh.js";import"./KeySelect-CCez0SUD.js";import"./index-DtAnyQJg.js";import"./translationFormatter-BuoX761Q.js";import"./filter-icon-BJy6kb4G.js";import"./TimeSelector-AVAQPnVp.js";import"./_baseFlatten-D0sQJfbp.js";const Ot=({requiredAction:i,onClose:n})=>{const{adminClient:l}=E(),{t}=C(),{addAlert:a,addError:s}=D(),[m,c]=T(),p=L(),{setValue:g,handleSubmit:h}=p,f=d=>{ne(d||{},g)};ae(async()=>{const d=await l.authenticationManagement.getRequiredActionConfigDescription({alias:i.alias}),y=await l.authenticationManagement.getRequiredActionConfig({alias:i.alias});return d.properties=[...d.properties],{configDescription:d,config:y}},({configDescription:d,config:y})=>{c(d),f(y)},[]);const v=async d=>{const y=ie(d);try{await l.authenticationManagement.updateRequiredActionConfig({alias:i.alias},y),f(y),a(t("configSaveSuccess"),x.success),n()}catch(I){s("configSaveError",I)}};return e(we,{variant:ve.small,isOpen:!0,title:t("requiredActionConfig",{name:i.name}),onClose:n,children:b(Me,{id:"required-action-config-form",onSubmit:h(v),children:[e(U,{...p,children:e(Tt,{stringify:!0,properties:m?.properties||[]})}),b(K,{children:[e(w,{"data-testid":"save",variant:"primary",type:"submit",children:t("save")}),e(w,{"data-testid":"cancel",variant:O.link,onClick:n,children:t("cancel")}),b(w,{className:"pf-v5-u-ml-3xl","data-testid":"clear",variant:O.link,onClick:async()=>{await l.authenticationManagement.removeRequiredActionConfig({alias:i.alias}),p.reset({}),n()},children:[t("clear")," ",e(Rt,{})]})]})]})})},Dt=()=>{const{adminClient:i}=E(),{t:n}=C(),{addAlert:l,addError:t}=D(),[a,s]=T(),[m,c]=T(),[p,g]=T(0),h=()=>g(p+1),{realm:f}=_(),v=async()=>await(await Ie(`${Se(i.baseUrl)}admin/realms/${f}/ui-ext/authentication-management/required-actions`,{method:"GET",headers:Ce(await i.getAccessToken())})).json();ae(async()=>{const[r,A]=await Promise.all([v(),i.authenticationManagement.getUnregisteredRequiredActions()]);return[...r.map(o=>({name:o.name,enabled:o.enabled,defaultAction:o.defaultAction,data:o})),...A.map(o=>({name:o.name,enabled:!1,defaultAction:!1,data:o}))]},r=>s(r),[p]);const d=r=>!("alias"in r),y=async(r,A)=>{try{A in r?(r[A]=!r[A],delete r.configurable,await i.authenticationManagement.updateRequiredAction({alias:r.alias},r)):d(r)&&await i.authenticationManagement.registerRequiredAction({name:r.name,providerId:r.providerId}),h(),l(n("updatedRequiredActionSuccess"),x.success)}catch(o){t("updatedRequiredActionError",o)}},I=async(r,A)=>{try{const o=r.alias;for(let u=0;u<Math.abs(A);u++)A>0?await i.authenticationManagement.lowerRequiredActionPriority({alias:o}):await i.authenticationManagement.raiseRequiredActionPriority({alias:o});h(),l(n("updatedRequiredActionSuccess"),x.success)}catch(o){t("updatedRequiredActionError",o)}};return a?b(R,{children:[m&&e(Ot,{requiredAction:m,onClose:()=>c(void 0)}),e(St,{keyField:"name",onDragFinish:async(r,A)=>{const o=a.map(P=>P.name),u=A.indexOf(r),S=o.indexOf(r),H=a[S].data;if(!H.alias)return;const W=u-S;I(H,W)},columns:[{name:"name",displayKey:"action",width:50},{name:"enabled",displayKey:"enabled",cellRenderer:r=>e(Q,{id:`enable-${se(r.name||"")}`,label:n("on"),labelOff:n("off"),isChecked:r.enabled,onChange:()=>{y(r.data,"enabled")},"aria-label":r.name}),width:20},{name:"default",displayKey:"setAsDefaultAction",thTooltipText:"authDefaultActionTooltip",cellRenderer:r=>e(Q,{id:`default-${se(r.name||"")}`,label:n("on"),isDisabled:!r.enabled,labelOff:r.enabled?n("off"):n("disabledOff"),isChecked:r.defaultAction,onChange:()=>{y(r.data,"defaultAction")},"aria-label":r.name}),width:20},{name:"config",displayKey:"configure",cellRenderer:r=>r.data.configurable?e(w,{variant:"plain","aria-label":n("settings"),onClick:()=>c(r.data),children:e(wt,{})}):void 0,width:10}],data:a})]}):e(le,{})},Ht="_label_1u2bs_1",te={label:Ht},X=({label:i})=>b(R,{children:[e(Ve,{className:te.label})," ",i]}),Ft=({id:i,isSpecificClient:n,onClose:l})=>{const{adminClient:t}=E(),{t:a}=C(),s=async(m,c,p)=>(await Et(t,{id:i,type:n?"clients":"idp",first:m||0,max:c||10,search:p})).map(h=>({name:h}));return e(we,{header:b(Re,{children:[e(Z,{component:$e.h1,children:a("flowUsedBy")}),e(Z,{children:a("flowUsedByDescription",{value:a(n?"clients":"identiyProviders")})})]}),variant:ve.medium,isOpen:!0,onClose:l,actions:[e(w,{"data-testid":"cancel",id:"modal-cancel",onClick:l,children:a("close")},"cancel")],children:e(Ee,{loader:s,isPaginated:!0,ariaLabelKey:"usedBy",searchPlaceholderKey:"search",columns:[{name:"name"}]})})},qt=({authType:{id:i,usedBy:n}})=>{const{t:l}=C(),{realmRepresentation:t}=_(),[a,s]=J(),m=Object.entries(t).find(c=>c[1]===n?.values[0])?.[0];return b(R,{children:[a&&e(Ft,{id:i,onClose:s,isSpecificClient:n?.type==="SPECIFIC_CLIENTS"}),(n?.type==="SPECIFIC_PROVIDERS"||n?.type==="SPECIFIC_CLIENTS")&&(n.values.length<=8?e(Te,{"aria-label":l("usedBy"),bodyContent:b("div",{children:[l("appliedBy"+(n.t
1ype==="SPECIFIC_CLIENTS"?"Clients":"Providers"))," ",n.values.map((c,p)=>b(R,{children:[e("strong",{children:c}),p<n.values.length-1?", ":""]}))]},`usedBy-${i}-${n.values}`),children:e(w,{variant:"link",className:te.label,children:e(X,{label:l(`used.${n.type}`)})})},i):e(w,{variant:"link",className:te.label,onClick:s,children:e(X,{label:l(`used.${n.type}`)})})),n?.type==="DEFAULT"&&e(X,{label:l(`flow.${vt.get(m)}`)}),!n?.type&&l("used.notInUse")]})},Mt=["poll","ping"],B=10,G=600,be=0,ye=600,Vt=({realm:i,realmUpdated:n})=>{const{adminClient:l}=E(),{t}=C(),a=L({mode:"onChange"}),{realm:s}=_(),{addAlert:m,addError:c}=D(),p=h=>ne(h,a.setValue);oe(()=>p(i),[]);const g=async h=>{try{await l.realms.update({realm:s},ie(h));const f=await l.realms.findOne({realm:s});n(f),p(f),m(t("updateCibaSuccess"),x.success)}catch(f){c("updateCibaError",f)}};return e(V,{variant:"light",children:b(z,{role:"manage-realm",isHorizontal:!0,onSubmit:a.handleSubmit(g),children:[b(U,{...a,children:[e(j,{name:"attributes.cibaBackchannelTokenDeliveryMode",label:t("cibaBackchannelTokenDeliveryMode"),labelIcon:t("cibaBackchannelTokenDeliveryModeHelp"),options:Mt.map(h=>({key:h,value:t(`cibaBackhannelTokenDeliveryModes.${h}`)})),controller:{defaultValue:""}}),e(Y,{name:"attributes.cibaExpiresIn",type:"number",min:B,max:G,label:t("cibaExpiresIn"),labelIcon:t("cibaExpiresInHelp"),rules:{min:{value:B,message:t("greaterThan",{value:B})},max:{value:G,message:t("lessThan",{value:G})},required:t("required")}}),e(Y,{name:"attributes.cibaInterval",type:"number",min:B,max:G,label:t("cibaInterval"),labelIcon:t("cibaIntervalHelp"),rules:{min:{value:be,message:t("greaterThan",{value:be})},max:{value:ye,message:t("lessThan",{value:ye})},required:t("required")}}),e(j,{name:"attributes.cibaAuthRequestedUserHint",label:t("cibaAuthRequestedUserHint"),labelIcon:t("cibaAuthRequestedUserHintHelp"),options:["login_hint","id_token_hint","login_hint_token"],controller:{defaultValue:""},isDisabled:!0})]}),b(K,{children:[e(w,{"data-testid":"save",variant:"primary",type:"submit",isDisabled:!a.formState.isValid||!a.formState.isDirty,children:t("save")}),e(w,{"data-testid":"reload",variant:O.link,onClick:()=>p({...i}),children:t("reload")})]})]})})},F=["totp","hotp"],fe=["SHA1","SHA256","SHA512"],Ae=[6,8],$t=({realm:i,realmUpdated:n})=>{const{adminClient:l}=E(),{t}=C(),a=L({mode:"onChange"}),{control:s,reset:m,handleSubmit:c,formState:{isValid:p,isDirty:g}}=a,{realm:h}=_(),{addAlert:f,addError:v}=D(),d=De(),y=Le({name:"otpPolicyType",control:s,defaultValue:F[0]}),I=o=>m(o),r=Oe(()=>{const o=(i.otpSupportedApplications??[]).map(u=>t(`otpSupportedApplications.${u}`));return d(o,u=>u)},[i.otpSupportedApplications]);return e(V,{variant:"light",children:e(z,{role:"manage-realm",isHorizontal:!0,onSubmit:c(async o=>{try{await l.realms.update({realm:h},o);const u=await l.realms.findOne({realm:h});n(u),I(u),f(t("updateOtpSuccess"),x.success)}catch(u){v("updateOtpError",u)}}),className:"keycloak__otp_policies_authentication__form",children:b(U,{...a,children:[e(q,{label:t("otpType"),labelIcon:e(M,{helpText:t("otpTypeHelp"),fieldLabelId:"otpType"}),hasNoPaddingTop:!0,children:e(ee,{name:"otpPolicyType","data-testid":"otpPolicyType",defaultValue:F[0],control:s,render:({field:o})=>e(R,{children:F.map(u=>e(ce,{id:u,"data-testid":u,isChecked:o.value===u,name:"otpPolicyType",onChange:()=>o.onChange(u),label:t(`policyType.${u}`),className:"keycloak__otp_policies_authentication__policy-type"},u))})})}),e(j,{name:"otpPolicyAlgorithm",label:t("otpHashAlgorithm"),labelIcon:t("otpHashAlgorithmHelp"),options:fe.map(o=>({key:`Hmac${o}`,value:o})),controller:{defaultValue:`Hmac${fe[0]}`}}),e(q,{label:t("otpPolicyDigits"),labelIcon:e(M,{helpText:t("otpPolicyDigitsHelp"),fieldLabelId:"otpPolicyDigits"}),hasNoPaddingTop:!0,children:e(ee,{name:"otpPolicyDigits","data-testid":"otpPolicyDigits",defaultValue:Ae[0],control:s,render:({field:o})=>e(R,{children:Ae.map(u=>e(ce,{id:`digit-${u}`,"data-testid":`digit-${u}`,isChecked:o.value===u,name:"otpPolicyDigits",onChange:()=>o.onChange(u),label:u,className:"keycloak__otp_policies_authentication__number-of-digits"},u))})})}),e(de,{name:"otpPolicyLookAheadWindow",label:t("lookAround"),labelIcon:t("lookAroundHelp"),controller:{defaultValue:1,rules:{min:0}}}),y===F[0]&&e(He,{name:"otpPolicyPeriod",label:t("otpPolicyPeriod"),labelIcon:t("otpPolicyPeriodHelp"),units:["second","minute"],controller:{defaultValue:30,rules:{min:1,max:{value:120,message:t("maxLength",{length:"2 "+t("minutes")})}}}}),y===F[1]&&e(de,{name:"otpPolicyInitialCounter",label:t("initialCounter"),labelIcon:t("initialCounterHelp"),controller:{defaultValue:30,rules:{min:1,max:120}}}),e(q,{label:t("supportedApplications"),labelIcon:e(M,{helpText:t("supportedApplications
1Help"),fieldLabelId:"supportedApplications"}),children:e("span",{"data-testid":"supportedApplications",children:e(Ue,{children:r.map(o=>e(Ke,{isReadOnly:!0,children:o},o))})})}),y===F[0]&&e(_e,{name:"otpPolicyCodeReusable",label:t("otpPolicyCodeReusable"),labelIcon:t("otpPolicyCodeReusableHelp"),labelOn:t("on"),labelOff:t("off")}),b(K,{children:[e(w,{"data-testid":"save",variant:"primary",type:"submit",isDisabled:!p||!g,children:t("save")}),e(w,{"data-testid":"reload",variant:O.link,onClick:()=>m({...i}),children:t("reload")})]})]})})})},Lt=({policy:{id:i,configType:n,defaultValue:l,displayName:t},onRemove:a})=>{const{t:s}=C(),{control:m,register:c,formState:{errors:p}}=Be(),g=p[i];return b(q,{label:t,fieldId:i,isRequired:!0,labelIcon:e(M,{helpText:s(`passwordPoliciesHelp.${i}`),fieldLabelId:i}),children:[b(Ge,{children:[b(ue,{isFilled:!0,children:[n&&n!=="int"&&e(je,{id:i,"data-testid":i,...c(i,{required:!0}),defaultValue:l,validated:g?me.error:me.default}),n==="int"&&e(ee,{name:i,defaultValue:Number.parseInt(l||"0"),control:m,render:({field:h})=>{const v=y=>h.onChange(Math.max(y,0)),d=Number(h.value);return e(Ye,{id:i,value:d,min:0,onPlus:()=>v(d+1),onMinus:()=>v(d-1),onChange:y=>{const I=Number(y.currentTarget.value);v(isNaN(I)?0:I)},className:"keycloak__policies_authentication__number-field"})}}),!n&&e(Q,{id:i,label:s("on"),labelOff:s("off"),isChecked:!0,isDisabled:!0,"aria-label":t})]}),e(ue,{children:e(w,{"data-testid":`remove-${i}`,variant:"link",className:"keycloak__policies_authentication__minus-icon",onClick:()=>a(i),"aria-label":s("remove"),children:e(ze,{})})})]}),g&&e(We,{message:s("required")})]})},Fe=" and ",Ut=(i,n)=>i.map(l=>`${l.id}(${n[l.id]})`).join(Fe),Kt=(i,n)=>i.split(Fe).map(Bt).reduce((l,{id:t,value:a})=>{const s=n.find(m=>m.id===t);return s?l.concat({...s,value:a}):l},[]);function Bt(i){const n=i.indexOf("(");if(n===-1)return{id:i.trim()};const l=i.substring(0,n).trim(),t=i.lastIndexOf(")");if(t===-1)return{id:l};const a=i.substring(n+1,t).trim();return{id:l,value:a}}const ge=({onSelect:i,selectedPolicies:n})=>{const{t:l}=C(),{passwordPolicies:t}=ke(),[a,s]=T(!1),m=Oe(()=>t?.filter(c=>n.find(p=>p.id===c.id)===void 0),[n]);return e(ot,{onSelect:(c,p)=>{i(p),s(!1)},toggle:c=>e(rt,{ref:c,onClick:()=>s(!a),isExpanded:a,isDisabled:m?.length===0,style:{width:"300px"},"data-testid":"add-policy",children:l("addPolicy")}),isOpen:a,children:e(st,{children:m?.map(c=>e(ct,{value:c,children:c.displayName},c.id))})})},Gt=({realm:i,realmUpdated:n})=>{const{adminClient:l}=E(),{t}=C(),{passwordPolicies:a}=ke(),{addAlert:s,addError:m}=D(),{realm:c}=_(),[p,g]=T([]),h=o=>{g([...p,o]),d(o.id,o.defaultValue,{shouldDirty:!0})},f=L({defaultValues:{}}),{handleSubmit:v,setValue:d,reset:y,formState:{isDirty:I}}=f,r=o=>{y();const u=Kt(o.passwordPolicy||"",a);u.forEach(S=>{d(S.id,S.value)}),g(u)};oe(()=>r(i),[]);const A=async o=>{const u={...i,passwordPolicy:Ut(p,o)};try{await l.realms.update({realm:c},u),n(u),r(u),s(t("updatePasswordPolicySuccess"),x.success)}catch(S){m("updatePasswordPolicyError",S)}};return b(V,{variant:"light",className:"pf-v5-u-p-0",children:[(p.length!==0||i.passwordPolicy)&&b(R,{children:[e(Xe,{children:e(Qe,{children:e(Ne,{children:e(ge,{onSelect:h,selectedPolicies:p})})})}),e(Je,{}),e(V,{variant:"light",children:e(U,{...f,children:b(z,{className:"keycloak__policies_authentication__form",role:"manage-realm",isHorizontal:!0,onSubmit:v(A),children:[p.map((o,u)=>e(Lt,{policy:o,onRemove:S=>{g(p.filter(H=>H.id!==S)),d(o.id,"",{shouldDirty:!0})}},`${o.id}-${u}`)),b(K,{children:[e(w,{"data-testid":"save",variant:"primary",type:"submit",isDisabled:!I,children:t("save")}),e(w,{"data-testid":"reload",variant:O.link,onClick:()=>r(i),children:t("reload")})]})]})})})]}),!p.length&&!i.passwordPolicy&&b(Ze,{"data-testid":"empty-state",variant:"lg",children:[e(et,{titleText:e(R,{children:t("noPasswordPolicies")}),icon:e(tt,{icon:at}),headingLevel:"h1"}),e(nt,{children:t("noPasswordPoliciesInstructions")}),e(it,{children:e(lt,{children:e(ge,{onSelect:h,selectedPolicies:[]})})})]})]})},jt=["ES256","ES384","ES512","RS256","RS384","RS512","Ed25519","RS1"],Yt=["not specified","none","indirect","direct"],zt=["not specified","platform","cross-platform"],Wt=["not specified","Yes","No"],Xt=["not specified","required","preferred","discouraged"],$=({name:i,label:n,labelIcon:l,options:t,labelPrefix:a,isMultiSelect:s=!1})=>{const{t:m}=C();return e(j,{name:i,label:n,labelIcon:l,variant:s?"typeaheadMulti":"single",controller:{defaultValue:t[0]},options:t.map(c=>
1({key:c,value:a?m(`${a}.${c}`):c}))})},Pe=({realm:i,realmUpdated:n,isPasswordLess:l=!1})=>{const{adminClient:t}=E(),{t:a}=C(),{addAlert:s,addError:m}=D(),{realm:c}=_(),{enabled:p}=dt(),g=L({mode:"onChange"}),{setValue:h,handleSubmit:f,formState:{isDirty:v}}=g,d=l?"webAuthnPolicyPasswordless":"webAuthnPolicy",y=r=>ne(r,h);oe(()=>y(i),[]);const I=async r=>{const A=ie(r);try{await t.realms.update({realm:c},A),n(A),y(A),s(a("webAuthnUpdateSuccess"),x.success)}catch(o){m("webAuthnUpdateError",o)}};return b(V,{variant:"light",children:[p&&e(Te,{bodyContent:a(`${d}FormHelp`),children:e(Re,{className:"keycloak__section_intro__help",children:b(Z,{children:[e(_t,{})," ",a("webauthnIntro")]})})}),b(z,{role:"manage-realm",isHorizontal:!0,onSubmit:f(I),className:"keycloak__webauthn_policies_authentication__form",children:[b(U,{...g,children:[e(Y,{name:`${d}RpEntityName`,label:a("webAuthnPolicyRpEntityName"),labelIcon:a("webAuthnPolicyRpEntityNameHelp"),rules:{required:a("required")}}),e($,{name:`${d}SignatureAlgorithms`,label:a("webAuthnPolicySignatureAlgorithms"),labelIcon:a("webAuthnPolicySignatureAlgorithmsHelp"),options:jt,isMultiSelect:!0}),e(Y,{name:`${d}RpId`,label:a("webAuthnPolicyRpId"),labelIcon:a("webAuthnPolicyRpIdHelp")}),e($,{name:`${d}AttestationConveyancePreference`,label:a("webAuthnPolicyAttestationConveyancePreference"),labelIcon:a("webAuthnPolicyAttestationConveyancePreferenceHelp"),options:Yt,labelPrefix:"attestationPreference"}),e($,{name:`${d}AuthenticatorAttachment`,label:a("webAuthnPolicyAuthenticatorAttachment"),labelIcon:a("webAuthnPolicyAuthenticatorAttachmentHelp"),options:zt,labelPrefix:"authenticatorAttachment"}),e($,{name:`${d}RequireResidentKey`,label:a("webAuthnPolicyRequireResidentKey"),labelIcon:a("webAuthnPolicyRequireResidentKeyHelp"),options:Wt,labelPrefix:"residentKey"}),e($,{name:`${d}UserVerificationRequirement`,label:a("webAuthnPolicyUserVerificationRequirement"),labelIcon:a("webAuthnPolicyUserVerificationRequirementHelp"),options:Xt,labelPrefix:"userVerify"}),e(He,{name:`${d}CreateTimeout`,label:a("webAuthnPolicyCreateTimeout"),labelIcon:a("webAuthnPolicyCreateTimeoutHelp"),units:["second","minute","hour"],controller:{defaultValue:0,rules:{min:0,max:{value:31536,message:a("webAuthnPolicyCreateTimeoutHint")}}}}),e(_e,{name:`${d}AvoidSameAuthenticatorRegister`,label:a("webAuthnPolicyAvoidSameAuthenticatorRegister"),labelIcon:a("webAuthnPolicyAvoidSameAuthenticatorRegisterHelp"),labelOn:a("on"),labelOff:a("off")}),e(q,{label:a("webAuthnPolicyAcceptableAaguids"),fieldId:"webAuthnPolicyAcceptableAaguids",labelIcon:e(M,{helpText:a("webAuthnPolicyAcceptableAaguidsHelp"),fieldLabelId:"webAuthnPolicyAcceptableAaguids"}),children:e(he,{name:`${d}AcceptableAaguids`,"aria-label":a("webAuthnPolicyAcceptableAaguids"),addButtonLabel:"addAaguids"})}),e(q,{label:a("webAuthnPolicyExtraOrigins"),fieldId:"webAuthnPolicyExtraOrigins",labelIcon:e(M,{helpText:a("webAuthnPolicyExtraOriginsHelp"),fieldLabelId:"webAuthnPolicyExtraOrigins"}),children:e(he,{name:`${d}ExtraOrigins`,"aria-label":a("webAuthnPolicyExtraOrigins"),addButtonLabel:"addOrigins"})})]}),b(K,{children:[e(w,{"data-testid":"save",variant:"primary",type:"submit",isDisabled:!v,children:a("save")}),e(w,{"data-testid":"reload",variant:O.link,onClick:()=>y(i),children:a("reload")})]})]})]})},Qt=()=>{const{adminClient:i}=E(),{t:n}=C(),[l,t]=T(1),{realm:a}=_(),[s,m]=T();return ae(async()=>{const c=await i.realms.findOne({realm:a});if(!c)throw new Error(n("notFound"));return c},c=>{m(c)},[]),s?b(kt,{activeKey:l,onSelect:(c,p)=>t(p),mountOnEnter:!0,unmountOnExit:!0,children:[e(k,{id:"passwordPolicy",eventKey:1,title:e(N,{children:n("passwordPolicy")}),children:e(Gt,{realm:s,realmUpdated:m})}),e(k,{id:"otpPolicy",eventKey:2,title:e(N,{children:n("otpPolicy")}),children:e($t,{realm:s,realmUpdated:m})}),e(k,{id:"webauthnPolicy",eventKey:3,title:e(N,{children:n("webauthnPolicy")}),children:e(Pe,{realm:s,realmUpdated:m})}),e(k,{id:"webauthnPasswordlessPolicy",eventKey:4,title:e(N,{children:n("webauthnPasswordlessPolicy")}),children:e(Pe,{realm:s,realmUpdated:m,isPasswordLess:!0})}
1),e(k,{"data-testid":"tab-ciba-policy",eventKey:5,title:e(N,{children:n("cibaPolicy")}),children:e(Vt,{realm:s,realmUpdated:m})})]}):e(le,{})},Jt=({id:i,alias:n,usedBy:l,builtIn:t})=>{const{t:a}=C(),{realm:s}=_();return b(R,{children:[e(xe,{to:ht({realm:s,id:i,usedBy:l?.type||"notInUse",builtIn:t?"builtIn":void 0}),children:n},`link-${i}`)," ",t&&e(bt,{children:a("buildIn")},`label-${i}`)]})};function Oa(){const{adminClient:i}=E(),{t:n}=C(),{realm:l,realmRepresentation:t}=_(),[a,s]=T(0),m=()=>s(a+1),{addAlert:c,addError:p}=D(),g=De(),[h,f]=T(),[v,d]=J(),[y,I]=J(),r=async()=>{const re=await(await Ie(`${Se(i.baseUrl)}admin/realms/${l}/ui-ext/authentication-management/flows`,{method:"GET",headers:Ce(await i.getAccessToken())})).json();return re?xt(g(re,Pt("alias")),qe=>qe.usedBy?.type):[]},A=P=>At(pe({realm:l,tab:P})),o=A("flows"),u=A("required-actions"),S=A("policies"),[H,W]=yt({titleKey:"deleteConfirmFlow",children:b(Nt,{i18nKey:"deleteConfirmFlowMessage",children:[" ",e("strong",{children:{flow:h?h.alias:""}}),"."]}),continueButtonLabel:"delete",continueButtonVariant:O.danger,onConfirm:async()=>{try{await i.authenticationManagement.deleteFlow({flowId:h.id}),m(),c(n("deleteFlowSuccess"),x.success)}catch(P){p("deleteFlowError",P)}}});return t?b(R,{children:[e(W,{}),v&&e(It,{name:h?h.alias:"",description:h?.description,toggleDialog:d,onComplete:()=>{m(),d()}}),y&&e(Ct,{onClose:()=>{I(),m()},flowAlias:h?.alias}),e(gt,{titleKey:"titleAuthentication",subKey:"authenticationExplain",helpUrl:ut.authenticationUrl,divider:!1}),e(V,{variant:"light",className:"pf-v5-u-p-0",children:b(ft,{isBox:!0,defaultLocation:pe({realm:l,tab:"flows"}),children:[e(k,{"data-testid":"flows",title:e(N,{children:n("flows")}),...o,children:e(Ee,{loader:r,ariaLabelKey:"titleAuthentication",searchPlaceholderKey:"searchForFlow",toolbarItem:e(Ne,{children:e(w,{component:P=>e(xe,{...P,to:mt({realm:l})}),children:n("createFlow")})}),actionResolver:({data:P})=>[{title:n("duplicate"),onClick:()=>{d(),f(P)}},...P.usedBy?.type!=="DEFAULT"?[{title:n("bindFlow"),onClick:()=>{I(),f(P)}}]:[],...!P.builtIn&&!P.usedBy?[{title:n("delete"),onClick:()=>{f(P),H()}}]:[]],columns:[{name:"alias",displayKey:"flowName",cellRenderer:P=>e(Jt,{...P})},{name:"usedBy",displayKey:"usedBy",cellRenderer:P=>e(qt,{authType:P})},{name:"description",displayKey:"description"}],emptyState:e(pt,{message:n("emptyEvents"),instructions:n("emptyEventsInstructions")})},a)}),e(k,{"data-testid":"requiredActions",title:e(N,{children:n("requiredActions")}),...u,children:e(Dt,{})}),e(k,{"data-testid":"policies",title:e(N,{children:n("policies")}),...S,children:e(Qt,{})})]})})]}):e(le,{})}export{Oa as default};
2//# sourceMappingURL=AuthenticationSection-CTMjSoJ4.js.map

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.