From 51b5af55d0d321c61dcde711641746656eb5f637 Mon Sep 17 00:00:00 2001 From: Mauricio Siu Date: Sat, 6 Jun 2026 13:27:17 -0600 Subject: [PATCH] refactor: enhance forward authentication UI and API integration - Updated the alert block in the HandleForwardAuth component to provide clearer requirements for deploying the authentication proxy. - Added a DnsHelperModal to assist with DNS configuration in the ForwardAuthServers component. - Refined API input schemas for forward authentication operations to improve type safety and clarity. - Removed the obsolete forward-auth SSO design document to streamline documentation. These changes improve the user experience and maintainability of the forward authentication feature across the application. --- .../domains/handle-forward-auth.tsx | 24 +- .../proprietary/sso/forward-auth-servers.tsx | 17 + .../api/routers/proprietary/forward-auth.ts | 27 +- docs/design/forward-auth-sso.md | 375 ------------------ packages/server/src/db/schema/forward-auth.ts | 13 + .../src/services/proprietary/forward-auth.ts | 25 +- 6 files changed, 84 insertions(+), 397 deletions(-) delete mode 100644 docs/design/forward-auth-sso.md diff --git a/apps/dokploy/components/dashboard/application/domains/handle-forward-auth.tsx b/apps/dokploy/components/dashboard/application/domains/handle-forward-auth.tsx index 86bf0a5b4..fc0d8dc43 100644 --- a/apps/dokploy/components/dashboard/application/domains/handle-forward-auth.tsx +++ b/apps/dokploy/components/dashboard/application/domains/handle-forward-auth.tsx @@ -97,12 +97,28 @@ export const HandleForwardAuth = ({ domainId, applicationId }: Props) => { - - The authentication proxy must be deployed for this app's server in SSO - settings. The domain must share its base domain. + +
+ Requirements +
    +
  1. + The authentication proxy container must be deployed and running + on this app's server. Configure it under{" "} + + Settings → SSO → Application Authentication + + . +
  2. +
  3. + This domain must share the same base domain as the + authentication domain (e.g. app.acme.com and{" "} + auth.acme.com). +
  4. +
+
-
+
Protect this domain with SSO diff --git a/apps/dokploy/components/proprietary/sso/forward-auth-servers.tsx b/apps/dokploy/components/proprietary/sso/forward-auth-servers.tsx index 52ce92a37..50e9377ce 100644 --- a/apps/dokploy/components/proprietary/sso/forward-auth-servers.tsx +++ b/apps/dokploy/components/proprietary/sso/forward-auth-servers.tsx @@ -10,6 +10,7 @@ import { } from "lucide-react"; import { useEffect, useState } from "react"; import { toast } from "sonner"; +import { DnsHelperModal } from "@/components/dashboard/application/domains/dns-helper-modal"; import { AlertBlock } from "@/components/shared/alert-block"; import { DialogAction } from "@/components/shared/dialog-action"; import { Badge } from "@/components/ui/badge"; @@ -61,6 +62,7 @@ export const ForwardAuthServers = () => { return () => clearTimeout(id); }, []); + const { data: hostIp } = api.settings.getIp.useQuery(); const { data: servers, isPending } = api.forwardAuth.serverStatus.useQuery( undefined, { enabled, refetchOnWindowFocus: false, staleTime: 30_000 }, @@ -236,6 +238,10 @@ export const ForwardAuthServers = () => { domain (e.g. auth.acme.com) per server, register its callback URL once in your identity provider, then deploy the proxy. Apps on that server under the same base domain are then one click to protect. + + Only OIDC providers are supported — SAML is not compatible with the + forward-auth proxy. + @@ -289,6 +295,17 @@ export const ForwardAuthServers = () => { } className="font-mono text-sm" /> + {f?.host && !f.host.includes("sslip.io") && ( + + )}