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

theme.keycloak.v2.admin.resources.assets.SamlGeneralSettings-202dd741.js Maven / Gradle / Ivy

There is a newer version: 25.0.1
Show newest version
import{u as y,r as v,j as e,a as L,Q as A,F as r,h as o,V as m,C as g,c as M,aV as U}from"./index-831988f6.js";import{K}from"./KeycloakTextArea-3e2614e3.js";import{K as x}from"./KeycloakTextInput-ead44014.js";import{S as u,F as V,T as B}from"./discovery-settings-0e7750f9.js";import{E as H}from"./ExpandableSection-4ded5b10.js";import{S,a as b,b as l}from"./Select-9c61d949.js";import{N}from"./NumberInput-25f268d9.js";import{F as G}from"./ViewHeader-2b1ad3ef.js";import{R as Q,D as X}from"./DisplayOrder-8e5ff983.js";const w=({readOnly:t})=>{const{t:i}=y("identity-providers"),{t:s}=y("identity-providers-help"),{register:p,control:d,formState:{errors:h}}=L(),[j,I]=v.useState(!1),[P,T]=v.useState(!1),[D,k]=v.useState(!1),[E,R]=v.useState(!1),[_,C]=v.useState(!1),F=A({control:d,name:"config.wantAuthnRequestsSigned"}),O=A({control:d,name:"config.validateSignature"}),q=A({control:d,name:"config.principalType"});return e.jsxs("div",{className:"pf-c-form pf-m-horizontal",children:[e.jsx(r,{label:i("serviceProviderEntityId"),fieldId:"kc-saml-service-provider-entity-id",labelIcon:e.jsx(o,{helpText:i("identity-providers-help:serviceProviderEntityId"),fieldLabelId:"identity-providers:serviceProviderEntityId"}),children:e.jsx(x,{"data-testid":"serviceProviderEntityId",id:"kc-saml-service-provider-entity-id",...p("config.entityId")})}),e.jsx(r,{label:i("identityProviderEntityId"),fieldId:"kc-identity-provider-entity-id",labelIcon:e.jsx(o,{helpText:i("identity-providers-help:identityProviderEntityId"),fieldLabelId:"identity-providers:identityProviderEntityId"}),children:e.jsx(x,{"data-testid":"identityProviderEntityId",id:"kc-identity-provider-entity-id",...p("config.idpEntityId")})}),e.jsx(r,{label:i("ssoServiceUrl"),labelIcon:e.jsx(o,{helpText:s("ssoServiceUrl"),fieldLabelId:"identity-providers:ssoServiceUrl"}),fieldId:"kc-sso-service-url",isRequired:!0,validated:h.config?.singleSignOnServiceUrl?m.error:m.default,helperTextInvalid:i("common:required"),children:e.jsx(x,{type:"url","data-testid":"sso-service-url",id:"kc-sso-service-url",validated:h.config?.singleSignOnServiceUrl?m.error:m.default,isReadOnly:t,...p("config.singleSignOnServiceUrl",{required:!0})})}),e.jsx(r,{label:i("singleLogoutServiceUrl"),labelIcon:e.jsx(o,{helpText:s("singleLogoutServiceUrl"),fieldLabelId:"identity-providers:singleLogoutServiceUrl"}),fieldId:"single-logout-service-url","data-testid":"single-logout-service-url",validated:h.config?.singleLogoutServiceUrl?m.error:m.default,helperTextInvalid:i("common:required"),children:e.jsx(x,{type:"url",id:"single-logout-service-url",isReadOnly:t,...p("config.singleLogoutServiceUrl")})}),e.jsx(u,{field:"config.backchannelSupported",label:"backchannelLogout","data-testid":"backchannelLogout",isReadOnly:t}),e.jsx(r,{label:i("nameIdPolicyFormat"),labelIcon:e.jsx(o,{helpText:s("nameIdPolicyFormat"),fieldLabelId:"identity-providers:nameIdPolicyFormat"}),fieldId:"kc-nameIdPolicyFormat",helperTextInvalid:i("common:required"),children:e.jsx(g,{name:"config.nameIDPolicyFormat",defaultValue:"urn:oasis:names:tc:SAML:2.0:nameid-format:persistent",control:d,render:({field:a})=>e.jsxs(S,{toggleId:"kc-nameIdPolicyFormat",onToggle:n=>I(n),isOpen:j,onSelect:(n,c)=>{a.onChange(c),I(!1)},selections:a.value,variant:b.single,isDisabled:t,children:[e.jsx(l,{"data-testid":"persistent-option",value:"urn:oasis:names:tc:SAML:2.0:nameid-format:persistent",isPlaceholder:!0,children:i("persistent")}),e.jsx(l,{"data-testid":"transient-option",value:"urn:oasis:names:tc:SAML:2.0:nameid-format:transient",children:i("transient")}),e.jsx(l,{"data-testid":"email-option",value:"urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress",children:i("email")}),e.jsx(l,{"data-testid":"kerberos-option",value:"urn:oasis:names:tc:SAML:2.0:nameid-format:kerberos",children:i("kerberos")}),e.jsx(l,{"data-testid":"x509-option",value:"urn:oasis:names:tc:SAML:1.1:nameid-format:X509SubjectName",children:i("x509")}),e.jsx(l,{"data-testid":"windowsDomainQN-option",value:"urn:oasis:names:tc:SAML:1.1:nameid-format:WindowsDomainQualifiedName",children:i("windowsDomainQN")}),e.jsx(l,{"data-testid":"unspecified-option",value:"urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified",children:i("unspecified")})]})})}),e.jsx(r,{label:i("principalType"),labelIcon:e.jsx(o,{helpText:s("principalType"),fieldLabelId:"identity-providers:principalType"}),fieldId:"kc-principalType",helperTextInvalid:i("common:required"),children:e.jsx(g,{name:"config.principalType",defaultValue:i("subjectNameId"),control:d,render:({field:a})=>e.jsxs(S,{toggleId:"kc-principalType",onToggle:n=>T(n),isOpen:P,onSelect:(n,c)=>{a.onChange(c.toString()),T(!1)},selections:a.value,variant:b.single,isDisabled:t,children:[e.jsx(l,{"data-testid":"subjectNameId-option",value:"SUBJECT",isPlaceholder:!0,children:i("subjectNameId")}),e.jsx(l,{"data-testid":"attributeName-option",value:"ATTRIBUTE",children:i("attributeName")}),e.jsx(l,{"data-testid":"attributeFriendlyName-option",value:"FRIENDLY_ATTRIBUTE",children:i("attributeFriendlyName")})]})})}),q?.includes("ATTRIBUTE")&&e.jsx(r,{label:i("principalAttribute"),labelIcon:e.jsx(o,{helpText:s("principalAttribute"),fieldLabelId:"identity-providers:principalAttribute"}),fieldId:"principalAttribute",children:e.jsx(x,{id:"principalAttribute","data-testid":"principalAttribute",isReadOnly:t,...p("config.principalAttribute")})}),e.jsx(u,{field:"config.allowCreate",label:"allowCreate",isReadOnly:t}),e.jsx(u,{field:"config.postBindingResponse",label:"httpPostBindingResponse",isReadOnly:t}),e.jsx(u,{field:"config.postBindingAuthnRequest",label:"httpPostBindingAuthnRequest",isReadOnly:t}),e.jsx(u,{field:"config.postBindingLogout",label:"httpPostBindingLogout",isReadOnly:t}),e.jsx(u,{field:"config.wantAuthnRequestsSigned",label:"wantAuthnRequestsSigned",isReadOnly:t}),F==="true"&&e.jsxs(e.Fragment,{children:[e.jsx(r,{label:i("signatureAlgorithm"),labelIcon:e.jsx(o,{helpText:s("signatureAlgorithm"),fieldLabelId:"identity-providers:signatureAlgorithm"}),fieldId:"kc-signatureAlgorithm",children:e.jsx(g,{name:"config.signatureAlgorithm",defaultValue:"RSA_SHA256",control:d,render:({field:a})=>e.jsxs(S,{toggleId:"kc-signatureAlgorithm",onToggle:n=>k(n),isOpen:D,onSelect:(n,c)=>{a.onChange(c.toString()),k(!1)},selections:a.value,variant:b.single,isDisabled:t,children:[e.jsx(l,{value:"RSA_SHA1"}),e.jsx(l,{value:"RSA_SHA256",isPlaceholder:!0}),e.jsx(l,{value:"RSA_SHA256_MGF1"}),e.jsx(l,{value:"RSA_SHA512"}),e.jsx(l,{value:"RSA_SHA512_MGF1"}),e.jsx(l,{value:"DSA_SHA1"})]})})}),e.jsx(r,{label:i("encryptionAlgorithm"),labelIcon:e.jsx(o,{helpText:s("encryptionAlgorithm"),fieldLabelId:"identity-provider:encryptionAlgorithm"}),fieldId:"kc-encryptionAlgorithm",children:e.jsx(g,{name:"config.encryptionAlgorithm",defaultValue:"RSA-OAEP",control:d,render:({field:a})=>e.jsxs(S,{toggleId:"kc-encryptionAlgorithm",onToggle:n=>R(n),isOpen:E,onSelect:(n,c)=>{a.onChange(c.toString()),R(!1)},selections:a.value,variant:b.single,isDisabled:t,children:[e.jsx(l,{value:"RSA-OAEP"}),e.jsx(l,{value:"RSA1_5"})]})})}),e.jsx(r,{label:i("samlSignatureKeyName"),labelIcon:e.jsx(o,{helpText:s("samlSignatureKeyName"),fieldLabelId:"identity-providers:samlSignatureKeyName"}),fieldId:"kc-samlSignatureKeyName",children:e.jsx(g,{name:"config.xmlSigKeyInfoKeyNameTransformer",defaultValue:i("keyID"),control:d,render:({field:a})=>e.jsxs(S,{toggleId:"kc-samlSignatureKeyName",onToggle:n=>C(n),isOpen:_,onSelect:(n,c)=>{a.onChange(c.toString()),C(!1)},selections:a.value,variant:b.single,isDisabled:t,children:[e.jsx(l,{value:"NONE"}),e.jsx(l,{value:i("keyID"),isPlaceholder:!0}),e.jsx(l,{value:i("certSubject")})]})})})]}),e.jsx(u,{field:"config.wantAssertionsSigned",label:"wantAssertionsSigned",isReadOnly:t}),e.jsx(u,{field:"config.wantAssertionsEncrypted",label:"wantAssertionsEncrypted",isReadOnly:t}),e.jsx(u,{field:"config.forceAuthn",label:"forceAuthentication",isReadOnly:t}),e.jsx(u,{field:"config.validateSignature",label:"validateSignature",isReadOnly:t}),O==="true"&&e.jsx(V,{label:"validatingX509Certs",children:e.jsx(K,{id:"validatingX509Certs","data-testid":"validatingX509Certs",isReadOnly:t,...p("config.signingCertificate")})}),e.jsx(u,{field:"config.signSpMetadata",label:"signServiceProviderMetadata","data-testid":"signServiceProviderMetadata",isReadOnly:t}),e.jsx(u,{field:"config.loginHint",label:"passSubject","data-testid":"passSubject",isReadOnly:t}),e.jsx(r,{label:i("allowedClockSkew"),labelIcon:e.jsx(o,{helpText:s("allowedClockSkew"),fieldLabelId:"identity-providers:allowedClockSkew"}),fieldId:"allowedClockSkew",helperTextInvalid:i("common:required"),children:e.jsx(g,{name:"config.allowedClockSkew",defaultValue:0,control:d,render:({field:a})=>{const n=Number(a.value);return e.jsx(N,{"data-testid":"allowedClockSkew",inputName:"allowedClockSkew",min:0,max:2147483,value:n,readOnly:!0,onPlus:()=>a.onChange(n+1),onMinus:()=>a.onChange(n-1),onChange:c=>{const f=Number(c.target.value);a.onChange(f<0?0:f)}})}})}),e.jsx(r,{label:i("attributeConsumingServiceIndex"),labelIcon:e.jsx(o,{helpText:s("attributeConsumingServiceIndex"),fieldLabelId:"identity-providers:attributeConsumingServiceIndex"}),fieldId:"attributeConsumingServiceIndex",helperTextInvalid:i("common:required"),children:e.jsx(g,{name:"config.attributeConsumingServiceIndex",defaultValue:0,control:d,render:({field:a})=>{const n=Number(a.value);return e.jsx(N,{"data-testid":"attributeConsumingServiceIndex",inputName:"attributeConsumingServiceIndex",min:0,max:2147483,value:n,readOnly:!0,onPlus:()=>a.onChange(n+1),onMinus:()=>a.onChange(n-1),onChange:c=>{const f=Number(c.target.value);a.onChange(f<0?0:f)}})}})}),e.jsx(r,{label:i("attributeConsumingServiceName"),labelIcon:e.jsx(o,{helpText:s("attributeConsumingServiceName"),fieldLabelId:"identity-providers:attributeConsumingServiceName"}),fieldId:"attributeConsumingServiceName",helperTextInvalid:i("common:required"),children:e.jsx(x,{id:"attributeConsumingServiceName","data-testid":"attributeConsumingServiceName",isReadOnly:t,...p("config.attributeConsumingServiceName")})})]})},ae=({readOnly:t})=>{const{t:i}=y("identity-providers"),[s,p]=v.useState(!1);return t?e.jsx(H,{className:"keycloak__discovery-settings__metadata",toggleText:i(s?"hideMetaData":"showMetaData"),onToggle:d=>p(d),isExpanded:s,children:e.jsx(w,{readOnly:t})}):e.jsx(w,{readOnly:t})};const ne=({id:t,isAliasReadonly:i=!1})=>{const{t:s}=y("identity-providers"),{realm:p}=M(),{register:d,watch:h,formState:{errors:j}}=L(),I=h("alias");return e.jsxs(e.Fragment,{children:[e.jsx(Q,{id:t}),e.jsx(r,{label:s("alias"),labelIcon:e.jsx(o,{helpText:s("identity-providers-help:alias"),fieldLabelId:"identity-providers:alias"}),fieldId:"alias",isRequired:!0,validated:j.alias?m.error:m.default,helperTextInvalid:s("common:required"),children:e.jsx(x,{isRequired:!0,id:"alias","data-testid":"alias",isReadOnly:i,validated:j.alias?m.error:m.default,...d("alias",{required:!0})})}),e.jsx(B,{field:"displayName",label:"displayName","data-testid":"displayName"}),e.jsx(X,{}),e.jsx(r,{label:s("endpoints"),fieldId:"endpoints",labelIcon:e.jsx(o,{helpText:s("identity-providers-help:alias"),fieldLabelId:"identity-providers:alias"}),className:"keycloak__identity-providers__saml_link",children:e.jsx(G,{title:s("samlEndpointsLabel"),href:`${U.authUrl}/realms/${p}/broker/${I}/endpoint/descriptor`,isInline:!0})})]})};export{ae as D,ne as S};
//# sourceMappingURL=SamlGeneralSettings-202dd741.js.map




© 2015 - 2024 Weber Informatics LLC | Privacy Policy