diff --git a/messages/en-US.json b/messages/en-US.json index 2684646f..565a5598 100644 --- a/messages/en-US.json +++ b/messages/en-US.json @@ -2349,6 +2349,7 @@ "enterConfirmation": "Enter confirmation", "blueprintViewDetails": "Details", "defaultIdentityProvider": "Default Identity Provider", + "defaultIdentityProviderDescription": "When a default identity provider is selected, the user will be automatically redirected to the provider for authentication.", "editInternalResourceDialogNetworkSettings": "Network Settings", "editInternalResourceDialogAccessPolicy": "Access Policy", "editInternalResourceDialogAddRoles": "Add Roles", diff --git a/src/app/[orgId]/settings/resources/proxy/[niceId]/authentication/page.tsx b/src/app/[orgId]/settings/resources/proxy/[niceId]/authentication/page.tsx index 4c520733..08065dfc 100644 --- a/src/app/[orgId]/settings/resources/proxy/[niceId]/authentication/page.tsx +++ b/src/app/[orgId]/settings/resources/proxy/[niceId]/authentication/page.tsx @@ -16,7 +16,6 @@ import { SwitchInput } from "@app/components/SwitchInput"; import { Tag, TagInput } from "@app/components/tags/tag-input"; import { Alert, AlertDescription, AlertTitle } from "@app/components/ui/alert"; import { Button } from "@app/components/ui/button"; -import { CheckboxWithLabel } from "@app/components/ui/checkbox"; import { Form, FormControl, @@ -184,9 +183,6 @@ export default function ResourceAuthenticationPage() { const [ssoEnabled, setSsoEnabled] = useState(resource.sso); - const [autoLoginEnabled, setAutoLoginEnabled] = useState( - resource.skipToIdpId !== null && resource.skipToIdpId !== undefined - ); const [selectedIdpId, setSelectedIdpId] = useState( resource.skipToIdpId || null ); @@ -243,17 +239,12 @@ export default function ResourceAuthenticationPage() { text: w.email })) ); - if (autoLoginEnabled && !selectedIdpId && orgIdps.length > 0) { - setSelectedIdpId(orgIdps[0].idpId); - } hasInitializedRef.current = true; }, [ pageLoading, resourceRoles, resourceUsers, whitelist, - autoLoginEnabled, - selectedIdpId, orgIdps ]); @@ -269,16 +260,6 @@ export default function ResourceAuthenticationPage() { const data = usersRolesForm.getValues(); try { - // Validate that an IDP is selected if auto login is enabled - if (autoLoginEnabled && !selectedIdpId) { - toast({ - variant: "destructive", - title: t("error"), - description: t("selectIdpRequired") - }); - return; - } - const jobs = [ api.post(`/resource/${resource.resourceId}/roles`, { roleIds: data.roles.map((i) => parseInt(i.id)) @@ -288,7 +269,7 @@ export default function ResourceAuthenticationPage() { }), api.post(`/resource/${resource.resourceId}`, { sso: ssoEnabled, - skipToIdpId: autoLoginEnabled ? selectedIdpId : null + skipToIdpId: selectedIdpId }) ]; @@ -296,7 +277,7 @@ export default function ResourceAuthenticationPage() { updateResource({ sso: ssoEnabled, - skipToIdpId: autoLoginEnabled ? selectedIdpId : null + skipToIdpId: selectedIdpId }); updateAuthInfo({ @@ -619,88 +600,55 @@ export default function ResourceAuthenticationPage() { )} {ssoEnabled && allIdps.length > 0 && ( - <> -
- { - setAutoLoginEnabled( - checked as boolean +
+ + - setSelectedIdpId( - parseInt(value) - ) - } - value={ - selectedIdpId - ? selectedIdpId.toString() - : undefined - } - > - - - - - {allIdps.map( - (idp) => ( - - { - idp.text - } - - ) - )} - - -
- )} - + /> + + + + {t("none")} + + {allIdps.map((idp) => ( + + {idp.text} + + ))} + + +

+ {t( + "defaultIdentityProviderDescription" + )} +

+
)}