fixing labels in case of SAML (#2111)
This commit is contained in:
parent
9fa1c1303f
commit
0065e9c7c2
2 changed files with 21 additions and 7 deletions
|
@ -12,6 +12,7 @@ import { useRealm } from "../../context/realm-context/RealmContext";
|
|||
import { DescriptorSettings } from "./DescriptorSettings";
|
||||
import { getBaseUrl } from "../../util";
|
||||
import { DiscoveryEndpointField } from "../component/DiscoveryEndpointField";
|
||||
import environment from "../../environment";
|
||||
|
||||
export const SamlConnectSettings = () => {
|
||||
const { t } = useTranslation("identity-providers");
|
||||
|
@ -70,13 +71,18 @@ export const SamlConnectSettings = () => {
|
|||
fieldLabelId="identity-providers:serviceProviderEntityId"
|
||||
/>
|
||||
}
|
||||
isRequired
|
||||
helperTextInvalid={t("common:required")}
|
||||
validated={errors.config?.entityId ? "error" : "default"}
|
||||
>
|
||||
<TextInput
|
||||
type="text"
|
||||
name="config.entityId"
|
||||
data-testid="serviceProviderEntityId"
|
||||
id="kc-service-provider-entity-id"
|
||||
ref={register()}
|
||||
ref={register({ required: true })}
|
||||
validated={errors.config?.entityId ? "error" : "default"}
|
||||
defaultValue={`${environment.authServerUrl}/realms/${realm}`}
|
||||
/>
|
||||
</FormGroup>
|
||||
|
||||
|
|
|
@ -64,11 +64,15 @@ export const DiscoveryEndpointField = ({
|
|||
return (
|
||||
<>
|
||||
<FormGroup
|
||||
label={t("useDiscoveryEndpoint")}
|
||||
fieldId="kc-discovery-endpoint-switch"
|
||||
label={t(
|
||||
id === "oidc" ? "useDiscoveryEndpoint" : "useEntityDescriptor"
|
||||
)}
|
||||
fieldId="kc-discovery-endpoint"
|
||||
labelIcon={
|
||||
<HelpItem
|
||||
helpText="identity-providers-help:useDiscoveryEndpoint"
|
||||
helpText={`identity-providers-help:${
|
||||
id === "oidc" ? "useDiscoveryEndpoint" : "useEntityDescriptor"
|
||||
}`}
|
||||
fieldLabelId="identity-providers:discoveryEndpoint"
|
||||
/>
|
||||
}
|
||||
|
@ -83,11 +87,15 @@ export const DiscoveryEndpointField = ({
|
|||
</FormGroup>
|
||||
{discovery && (
|
||||
<FormGroup
|
||||
label={t("discoveryEndpoint")}
|
||||
label={t(
|
||||
id === "oidc" ? "discoveryEndpoint" : "samlEntityDescriptor"
|
||||
)}
|
||||
fieldId="kc-discovery-endpoint"
|
||||
labelIcon={
|
||||
<HelpItem
|
||||
helpText="identity-providers-help:discoveryEndpoint"
|
||||
helpText={`identity-providers-help:${
|
||||
id === "oidc" ? "discoveryEndpoint" : "samlEntityDescriptor"
|
||||
}`}
|
||||
fieldLabelId="identity-providers:discoveryEndpoint"
|
||||
/>
|
||||
}
|
||||
|
@ -113,7 +121,7 @@ export const DiscoveryEndpointField = ({
|
|||
placeholder={
|
||||
id === "oidc"
|
||||
? "https://hostname/auth/realms/master/.well-known/openid-configuration"
|
||||
: "https://hostname/context/saml/discovery"
|
||||
: ""
|
||||
}
|
||||
onBlur={() => setDiscovering(true)}
|
||||
validated={
|
||||
|
|
Loading…
Reference in a new issue