Skip to content

The easy-to-use open source Business Intelligence and Embedded Analytics tool that lets everyone work with data :bar_chart:

Clarify that SSO provisioning also allows reactivating accounts (#67524)

Rodrigo López Dato567bbd68bbfe
diff --git a/docs/people-and-groups/authenticating-with-jwt.md b/docs/people-and-groups/authenticating-with-jwt.md
index b385d61cbf6..c6056c84b39 100644
--- a/docs/people-and-groups/authenticating-with-jwt.md
+++ b/docs/people-and-groups/authenticating-with-jwt.md
@@ -95,7 +95,9 @@ If you add group mappings manually, Metabase will _not_ try to also match groups
> Paid plans [charge for each additional account](../cloud/how-billing-works.md#what-counts-as-a-user-account).
-A new SSO login will automatically create a new Metabase account.
+User provisioning is enabled by default. Metabase will create accounts for people who don't yet have a Metabase account but who are able to log in via JWT SSO.
+
+If you disable user provisioning, users without accounts or with deactivated accounts will not be able to log in via JWT SSO.
Metabase accounts created with an external identity provider login don't have passwords. People who sign up for Metabase using an IdP must continue to use the IdP to log into Metabase.
diff --git a/docs/people-and-groups/authenticating-with-saml.md b/docs/people-and-groups/authenticating-with-saml.md
index 0ea3cff1811..a89ddf55748 100644
--- a/docs/people-and-groups/authenticating-with-saml.md
+++ b/docs/people-and-groups/authenticating-with-saml.md
@@ -50,7 +50,9 @@ If you don't see your IdP listed here:
## User provisioning
-By default, Metabase will create accounts for people who don't yet have a Metabase account but who are able to log in via SAML SSO.
+User provisioning is enabled by default. Metabase will create accounts for people who don't yet have a Metabase account but who are able to log in via SAML SSO.
+
+If you disable user provisioning, users without accounts or with deactivated accounts will not be able to log in.
If you've set up [User provisioning with SCIM](./user-provisioning.md), you'll want to turn this setting off so that Metabase doesn't automatically create a new account for anyone who authenticates successfully, as you may want to use SCIM to determine who can and can't create an account in Metabase.
diff --git a/docs/people-and-groups/ldap.md b/docs/people-and-groups/ldap.md
index 847ee80f7a5..4295ea64c4e 100644
--- a/docs/people-and-groups/ldap.md
+++ b/docs/people-and-groups/ldap.md
@@ -28,7 +28,9 @@ In the **Admin** > **Settings** > **Authentication** > **LDAP**. Click the toggl
## User provisioning
-When a person logs in via LDAP, Metabase can create a Metabase account for them automatically (if they don't already have a Metabase account).
+User provisioning is enabled by default. Metabase will create accounts for people who don't yet have a Metabase account but who are able to log in via LDAP.
+
+If you disable user provisioning, users without accounts or with deactivated accounts will not be able to log in.
## Server settings
diff --git a/e2e/test/scenarios/admin-2/sso/jwt.cy.spec.js b/e2e/test/scenarios/admin-2/sso/jwt.cy.spec.js
index df92b526158..1d5d778f775 100644
--- a/e2e/test/scenarios/admin-2/sso/jwt.cy.spec.js
+++ b/e2e/test/scenarios/admin-2/sso/jwt.cy.spec.js
@@ -50,7 +50,7 @@ describe("scenarios > admin > settings > SSO > JWT", () => {
cy.visit("/admin/settings/authentication/jwt");
cy.findByTestId("jwt-user-provisioning-enabled?-setting")
- .findByText("Enabled")
+ .findByText(/^Disabled/)
.click();
cy.wait("@updateSetting");
diff --git a/e2e/test/scenarios/admin-2/sso/ldap.cy.spec.js b/e2e/test/scenarios/admin-2/sso/ldap.cy.spec.js
index 8d86808db7c..6581655f553 100644
--- a/e2e/test/scenarios/admin-2/sso/ldap.cy.spec.js
+++ b/e2e/test/scenarios/admin-2/sso/ldap.cy.spec.js
@@ -183,7 +183,7 @@ describe(
cy.visit("/admin/settings/authentication/ldap");
cy.findByTestId("ldap-user-provisioning-enabled?-setting")
- .findByText("Enabled")
+ .findByText(/^Disabled/)
.click();
H.undoToast().findByText("Changes saved").should("be.visible");
diff --git a/e2e/test/scenarios/admin-2/sso/saml.cy.spec.js b/e2e/test/scenarios/admin-2/sso/saml.cy.spec.js
index bc44cd71958..626e7cf7a81 100644
--- a/e2e/test/scenarios/admin-2/sso/saml.cy.spec.js
+++ b/e2e/test/scenarios/admin-2/sso/saml.cy.spec.js
@@ -79,7 +79,7 @@ describe("scenarios > admin > settings > SSO > SAML", () => {
cy.visit("/admin/settings/authentication/saml");
cy.findByTestId("saml-user-provisioning-enabled?-setting")
- .findByText("Enabled")
+ .findByText(/^Disabled/)
.click();
cy.wait("@updateSetting");
H.undoToast().findByText("Changes saved").should("exist");
diff --git a/enterprise/backend/src/metabase_enterprise/sso/settings.clj b/enterprise/backend/src/metabase_enterprise/sso/settings.clj
index 3bd898de300..9a608980211 100644
--- a/enterprise/backend/src/metabase_enterprise/sso/settings.clj
+++ b/enterprise/backend/src/metabase_enterprise/sso/settings.clj
@@ -24,8 +24,7 @@
(mr/validator GroupMappings))
(defsetting saml-user-provisioning-enabled?
- (deferred-tru "When we enable SAML user provisioning, we automatically create a Metabase account on SAML signin for users who
-don''t have one.")
+ (deferred-tru "Determines what happens when a user logs in via SAML and doesn''t have a Metabase account.")
:type :boolean
:default true
:feature :sso-saml
@@ -34,21 +33,23 @@ don''t have one.")
;; Disable SAML provisioning automatically when SCIM is enabled
false
(setting/get-value-of-type :boolean :saml-user-provisioning-enabled?)))
- :audit :getter)
+ :audit :getter
+ :doc "When set to `true`, users who log in via SAML will automatically get a Metabase account if they don't have one, or get their existing account reactivated. When set to `false`, only users with active Metabase accounts can log in via SAML.")
(defsetting jwt-user-provisioning-enabled?
- (deferred-tru "When a user logs in via JWT, create a Metabase account for them automatically if they don''t have one.")
+ (deferred-tru "Determines what happens when a user logs in via JWT and doesn''t have a Metabase account.")
:type :boolean
:default true
:feature :sso-jwt
- :audit :getter)
+ :audit :getter
+ :doc "When set to `true`, users who log in via JWT will automatically get a Metabase account if they don't have one, or get their existing account reactivated. When set to `false`, only users with active Metabase accounts can log in via JWT.")
(defsetting ldap-user-provisioning-enabled?
- (deferred-tru "When we enable LDAP user provisioning, we automatically create a Metabase account on LDAP signin for users who
-don''t have one.")
+ (deferred-tru "Determines what happens when a user logs in via LDAP and doesn''t have a Metabase account.")
:type :boolean
:default true
- :audit :getter)
+ :audit :getter
+ :doc "When set to `true`, users who log in via LDAP will automatically get a Metabase account if they don't have one, or get their existing account reactivated. When set to `false`, only users with active Metabase accounts can log in via LDAP.")
(defsetting saml-identity-provider-uri
(deferred-tru "This is the URL where your users go to log in to your identity provider. Depending on which IdP you''re
@@ -494,12 +495,13 @@ using, this usually looks like `https://your-org-name.example.com` or `https://e
:export? false)
(defsetting oidc-user-provisioning-enabled?
- (deferred-tru "When a user logs in via OIDC, create a Metabase account for them automatically if they don''t have one.")
+ (deferred-tru "Determines what happens when a user logs in via OIDC and doesn''t have a Metabase account.")
:type :boolean
:default true
:feature :sso-oidc
- :export? false
- :audit :getter)
+ :export? false
+ :audit :getter
+ :doc "When set to `true`, users who log in via OIDC will automatically get a Metabase account if they don't have one, or get their existing account reactivated. When set to `false`, only users with active Metabase accounts can log in via OIDC.")
(defsetting other-sso-enabled?
"Are we using an SSO integration other than LDAP or Google Auth or ODIC? These integrations use the `/auth/sso` endpoint for
diff --git a/enterprise/frontend/src/metabase-enterprise/auth/components/Ldap.tsx b/enterprise/frontend/src/metabase-enterprise/auth/components/Ldap.tsx
index 53c701eee2f..f5959d2c082 100644
--- a/enterprise/frontend/src/metabase-enterprise/auth/components/Ldap.tsx
+++ b/enterprise/frontend/src/metabase-enterprise/auth/components/Ldap.tsx
@@ -4,6 +4,7 @@ import { SettingsSection } from "metabase/admin/components/SettingsSection";
import { AdminSettingInput } from "metabase/admin/settings/components/widgets/AdminSettingInput";
import { useAdminSetting } from "metabase/api/utils";
import { FormTextInput } from "metabase/forms";
+import { provisioningOptions } from "metabase-enterprise/auth/utils";
export function LdapUserProvisioning() {
return (
@@ -11,7 +12,8 @@ export function LdapUserProvisioning() {
<AdminSettingInput
name="ldap-user-provisioning-enabled?"
title={t`User provisioning`}
- inputType="boolean"
+ inputType="radio"
+ options={provisioningOptions("LDAP")}
/>
</SettingsSection>
);
diff --git a/enterprise/frontend/src/metabase-enterprise/auth/components/SettingsJWTForm/SettingsJWTForm.tsx b/enterprise/frontend/src/metabase-enterprise/auth/components/SettingsJWTForm/SettingsJWTForm.tsx
index 33cbba3a3a0..8d703196870 100644
--- a/enterprise/frontend/src/metabase-enterprise/auth/components/SettingsJWTForm/SettingsJWTForm.tsx
+++ b/enterprise/frontend/src/metabase-enterprise/auth/components/SettingsJWTForm/SettingsJWTForm.tsx
@@ -24,6 +24,7 @@ import {
FormTextInput,
} from "metabase/forms";
import { Flex, Stack } from "metabase/ui";
+import { provisioningOptions } from "metabase-enterprise/auth/utils";
import type { EnterpriseSettings } from "metabase-types/api";
export type JWTFormValues = Pick<
@@ -72,7 +73,8 @@ export const SettingsJWTForm = () => {
<AdminSettingInput
name="jwt-user-provisioning-enabled?"
title={t`User provisioning`}
- inputType="boolean"
+ inputType="radio"
+ options={provisioningOptions("JWT")}
/>
</SettingsSection>
)}
diff --git a/enterprise/frontend/src/metabase-enterprise/auth/components/SettingsOIDCForm/SettingsOIDCForm.tsx b/enterprise/frontend/src/metabase-enterprise/auth/components/SettingsOIDCForm/SettingsOIDCForm.tsx
index 9eb655dceef..6a64417209c 100644
--- a/enterprise/frontend/src/metabase-enterprise/auth/components/SettingsOIDCForm/SettingsOIDCForm.tsx
+++ b/enterprise/frontend/src/metabase-enterprise/auth/components/SettingsOIDCForm/SettingsOIDCForm.tsx
@@ -32,6 +32,7 @@ import {
useGetCustomOidcProvidersQuery,
useUpdateCustomOidcMutation,
} from "metabase-enterprise/api";
+import { provisioningOptions } from "metabase-enterprise/auth/utils";
function getOidcFormSchema() {
return Yup.object({
@@ -272,7 +273,8 @@ export function SettingsOIDCForm() {
<AdminSettingInput
name="oidc-user-provisioning-enabled?"
title={t`User provisioning`}
- inputType="boolean"
+ inputType="radio"
+ options={provisioningOptions("OIDC")}
/>
</SettingsSection>
diff --git a/enterprise/frontend/src/metabase-enterprise/auth/components/SettingsSAMLForm/SettingsSAMLForm.tsx b/enterprise/frontend/src/metabase-enterprise/auth/components/SettingsSAMLForm/SettingsSAMLForm.tsx
index 26c91c98cf1..c5fd8f126f4 100644
--- a/enterprise/frontend/src/metabase-enterprise/auth/components/SettingsSAMLForm/SettingsSAMLForm.tsx
+++ b/enterprise/frontend/src/metabase-enterprise/auth/components/SettingsSAMLForm/SettingsSAMLForm.tsx
@@ -31,6 +31,7 @@ import {
} from "metabase/forms";
import { Flex, Stack, Text, Title } from "metabase/ui";
import { useUpdateSamlMutation } from "metabase-enterprise/api";
+import { provisioningOptions } from "metabase-enterprise/auth/utils";
import type { EnterpriseSettings } from "metabase-types/api";
export type SAMLFormSettings = Pick<
@@ -340,7 +341,8 @@ function SamlUserProvisioning() {
<AdminSettingInput
name="saml-user-provisioning-enabled?"
title={t`User provisioning`}
- inputType="boolean"
+ inputType="radio"
+ options={provisioningOptions("SAML")}
/>
</SettingsSection>
);
diff --git a/enterprise/frontend/src/metabase-enterprise/auth/utils.ts b/enterprise/frontend/src/metabase-enterprise/auth/utils.ts
index 74e28df352b..107ecb7b646 100644
--- a/enterprise/frontend/src/metabase-enterprise/auth/utils.ts
+++ b/enterprise/frontend/src/metabase-enterprise/auth/utils.ts
@@ -1,3 +1,5 @@
+import { t } from "ttag";
+
import { useGetSettingsQuery } from "metabase/api";
import { hasAnySsoFeature } from "metabase/common/utils/plan";
@@ -27,3 +29,15 @@ export function useHasAnySsoFeature() {
return hasAnySsoFeature(features);
}
+
+export function provisioningOptions(
+ label: string,
+): { label: string; value: string }[] {
+ const trueLabel = t`Enabled: When a user logs in via ${label}, automatically create an account for them if they don't have one, or reactivate their existing account.`;
+ // eslint-disable-next-line metabase/no-literal-metabase-strings -- Emphasizes the difference between Metabase accounts and SSO accounts
+ const falseLabel = t`Disabled: Only users with active Metabase accounts can log in using ${label}.`;
+ return [
+ { value: "true", label: trueLabel },
+ { value: "false", label: falseLabel },
+ ];
+}