diff --git a/frontend/src/component/admin/auth/OidcAuth/OidcAuth.tsx b/frontend/src/component/admin/auth/OidcAuth/OidcAuth.tsx index 6ee056235688..53f602332bcb 100644 --- a/frontend/src/component/admin/auth/OidcAuth/OidcAuth.tsx +++ b/frontend/src/component/admin/auth/OidcAuth/OidcAuth.tsx @@ -113,8 +113,8 @@ export const OidcAuth = () => { condition={Boolean(oidcConfiguredThroughEnv)} show={ - OIDC setup is currently controlled via - environment variables. Please see the{' '} + OIDC is currently configured via environment + variables. Please refer to the{' '} { > documentation {' '} - to learn how to set the correct environment - variables + for detailed instructions on how to set up OIDC + using these variables. } /> diff --git a/frontend/src/component/admin/auth/SamlAuth/SamlAuth.tsx b/frontend/src/component/admin/auth/SamlAuth/SamlAuth.tsx index 3514bbdcd693..e97d63921776 100644 --- a/frontend/src/component/admin/auth/SamlAuth/SamlAuth.tsx +++ b/frontend/src/component/admin/auth/SamlAuth/SamlAuth.tsx @@ -17,6 +17,7 @@ import { formatUnknownError } from 'utils/formatUnknownError'; import { removeEmptyStringFields } from 'utils/removeEmptyStringFields'; import { SsoGroupSettings } from '../SsoGroupSettings'; import type { IRole } from 'interfaces/role'; +import { ConditionallyRender } from 'component/common/ConditionallyRender/ConditionallyRender'; const initialState = { enabled: false, @@ -40,6 +41,7 @@ type State = typeof initialState & { export const SamlAuth = () => { const { setToastData, setToastApiError } = useToast(); const { uiConfig } = useUiConfig(); + const { samlConfiguredThroughEnv } = uiConfig; const [data, setData] = useState(initialState); const { config } = useAuthSettings('saml'); const { updateSettings, errors, loading } = useAuthSettingsApi('saml'); @@ -98,6 +100,24 @@ export const SamlAuth = () => { <> + + SAML is currently configured via environment + variables. Please refer to the{' '} + + documentation + {' '} + for detailed instructions on how to set up SAML + using these variables. + + } + /> Please read the{' '} { value={data.enabled} name='enabled' checked={data.enabled} + disabled={samlConfiguredThroughEnv} /> } label={data.enabled ? 'Enabled' : 'Disabled'} @@ -145,7 +166,7 @@ export const SamlAuth = () => { label='Entity ID' name='entityId' value={data.entityId} - disabled={!data.enabled} + disabled={!data.enabled || samlConfiguredThroughEnv} style={{ width: '400px' }} variant='outlined' size='small' @@ -167,7 +188,7 @@ export const SamlAuth = () => { label='Single Sign-On URL' name='signOnUrl' value={data.signOnUrl} - disabled={!data.enabled} + disabled={!data.enabled || samlConfiguredThroughEnv} style={{ width: '400px' }} variant='outlined' size='small' @@ -189,7 +210,7 @@ export const SamlAuth = () => { label='X.509 Certificate' name='certificate' value={data.certificate} - disabled={!data.enabled} + disabled={!data.enabled || samlConfiguredThroughEnv} style={{ width: '100%' }} InputProps={{ style: { @@ -221,7 +242,7 @@ export const SamlAuth = () => { label='Single Sign-out URL' name='signOutUrl' value={data.signOutUrl} - disabled={!data.enabled} + disabled={!data.enabled || samlConfiguredThroughEnv} style={{ width: '400px' }} variant='outlined' size='small' @@ -244,7 +265,7 @@ export const SamlAuth = () => { label='X.509 Certificate' name='spCertificate' value={data.spCertificate} - disabled={!data.enabled} + disabled={!data.enabled || samlConfiguredThroughEnv} style={{ width: '100%' }} InputProps={{ style: { @@ -265,12 +286,14 @@ export const SamlAuth = () => { ssoType='SAML' data={data} setValue={setValue} + disabled={samlConfiguredThroughEnv} /> @@ -278,7 +301,7 @@ export const SamlAuth = () => { variant='contained' color='primary' type='submit' - disabled={loading} + disabled={loading || samlConfiguredThroughEnv} > Save {' '} diff --git a/frontend/src/interfaces/uiConfig.ts b/frontend/src/interfaces/uiConfig.ts index 860e155cb3b4..0a7287509abe 100644 --- a/frontend/src/interfaces/uiConfig.ts +++ b/frontend/src/interfaces/uiConfig.ts @@ -31,6 +31,7 @@ export interface IUiConfig { frontendApiOrigins?: string[]; resourceLimits: ResourceLimitsSchema; oidcConfiguredThroughEnv?: boolean; + samlConfiguredThroughEnv?: boolean; } export interface IProclamationToast {