diff --git a/docs/self-hosting/configuration/envars.mdx b/docs/self-hosting/configuration/envars.mdx
index dae2e8044..db8034199 100644
--- a/docs/self-hosting/configuration/envars.mdx
+++ b/docs/self-hosting/configuration/envars.mdx
@@ -335,6 +335,10 @@ To login into Infisical with OAuth providers such as Google, configure the assoc
Requires enterprise license. Please contact team@infisical.com to get more information.
+
+ Configure SAML organization slug to automatically redirect all users of your Infisical instance to the identity provider.
+
+
diff --git a/frontend/src/views/Login/components/InitialStep/InitialStep.tsx b/frontend/src/views/Login/components/InitialStep/InitialStep.tsx
index 2e2d8f79b..fb191e372 100644
--- a/frontend/src/views/Login/components/InitialStep/InitialStep.tsx
+++ b/frontend/src/views/Login/components/InitialStep/InitialStep.tsx
@@ -32,6 +32,18 @@ export const InitialStep = ({ setStep, email, setEmail, password, setPassword }:
const { config } = useServerConfig();
const queryParams = new URLSearchParams(window.location.search);
+ useEffect(() => {
+ if (process.env.NEXT_PUBLIC_SAML_ORG_SLUG) {
+ const callbackPort = queryParams.get("callback_port");
+ window.open(
+ `/api/v1/sso/redirect/saml2/organizations/${process.env.NEXT_PUBLIC_SAML_ORG_SLUG}${
+ callbackPort ? `?callback_port=${callbackPort}` : ""
+ }`
+ );
+ window.close();
+ }
+ })
+
const handleLogin = async (e: FormEvent) => {
e.preventDefault();
try {