fixing labels in case of SAML (#2111)

This commit is contained in:
Erik Jan de Wit 2022-02-21 14:55:02 +01:00 committed by GitHub
parent 9fa1c1303f
commit 0065e9c7c2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 21 additions and 7 deletions

View file

@ -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>

View file

@ -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={