Skip to content

Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.

entra default diff

Thiago Araujo da Silva26a0356e4444
diff --git a/backend/AGENTS.md b/backend/AGENTS.md
index 6b59da5f76..35606dfa4a 100644
--- a/backend/AGENTS.md
+++ b/backend/AGENTS.md
@@ -304,7 +304,10 @@ org's MFA enforcement with the MFA the IdP already performed. The SAML and OIDC
per login with `matchIdpMfaSignal` (`services/auth/idp-mfa-signal.ts`): the OIDC claim named by
`oidc_configs.mfaClaimName` contains `mfa`, the SAML `AuthnContextClassRef` is a class whose definition asserts
two factors (possession-only classes such as `Smartcard` and `SoftwarePKI` are not defaults), or the
-attribute named by `saml_configs.mfaSignalAttribute` contains `mfa`. Both names default to `amr`, and the
+attribute named by `saml_configs.mfaSignalAttribute` contains `mfa` or `multipleauthn`. A null attribute name
+means the provider's default: Entra ID's `authnmethodsreferences` for `azure-saml`, because Entra reports a push
+or TOTP login as `Password` in `AuthnContextClassRef` and puts `multipleauthn` only there, and `amr` for every
+other provider. The OIDC claim name defaults to `amr`, and the
per-config allowlists extend the built-in values rather than replace them. The verdict travels on the org-less
session token as `idpMfaOrgId`, the root org whose SSO config produced it (absent when the IdP did not signal
MFA). A first login that still has to verify its mailbox carries it on the signup token instead, and
diff --git a/backend/src/db/migrations/20261029195045_sso-mfa-trust.ts b/backend/src/db/migrations/20261029195045_sso-mfa-trust.ts
index 7662106861..1aacf7618b 100644
--- a/backend/src/db/migrations/20261029195045_sso-mfa-trust.ts
+++ b/backend/src/db/migrations/20261029195045_sso-mfa-trust.ts
@@ -13,7 +13,7 @@ export async function up(knex: Knex): Promise<void> {
const hasSamlAuthnContexts = await knex.schema.hasColumn(TableName.SamlConfig, "mfaAuthnContexts");
if (!hasSamlSignalAttribute || !hasSamlAuthnContexts) {
await knex.schema.alterTable(TableName.SamlConfig, (t) => {
- if (!hasSamlSignalAttribute) t.string("mfaSignalAttribute", 512).notNullable().defaultTo("amr");
+ if (!hasSamlSignalAttribute) t.string("mfaSignalAttribute", 512).nullable();
if (!hasSamlAuthnContexts) t.specificType("mfaAuthnContexts", "text[]").nullable();
});
}
diff --git a/backend/src/db/schemas/saml-configs.ts b/backend/src/db/schemas/saml-configs.ts
index 42772ee721..a24f628b6f 100644
--- a/backend/src/db/schemas/saml-configs.ts
+++ b/backend/src/db/schemas/saml-configs.ts
@@ -30,7 +30,7 @@ export const SamlConfigsSchema = z.object({
encryptedSamlIssuer: zodBuffer,
encryptedSamlCertificate: zodBuffer,
enableGroupSync: z.boolean().default(false),
- mfaSignalAttribute: z.string().default("amr"),
+ mfaSignalAttribute: z.string().nullable().optional(),
mfaAuthnContexts: z.string().array().nullable().optional()
});
diff --git a/backend/src/ee/routes/v1/saml-router.ts b/backend/src/ee/routes/v1/saml-router.ts
index d494c815a7..2bf244c2a7 100644
--- a/backend/src/ee/routes/v1/saml-router.ts
+++ b/backend/src/ee/routes/v1/saml-router.ts
@@ -35,7 +35,7 @@ import { AuthMode, ProviderAuthResult, TProviderAuthCallback } from "@app/servic
import { extractSamlAuthnContextClassRefs, matchIdpMfaSignal } from "@app/services/auth/idp-mfa-signal";
import { PostHogEventTypes } from "@app/services/telemetry/telemetry-types";
-const SamlMfaSignalAttributeSchema = z.string().trim().min(1).max(512).optional();
+const SamlMfaSignalAttributeSchema = z.string().trim().min(1).max(512).nullable().optional();
const SamlMfaAuthnContextsSchema = z.array(z.string().trim().min(1).max(512)).max(20).nullable().optional();
type TSAMLConfig = {
@@ -447,7 +447,7 @@ export const registerSamlRouter = async (server: FastifyZodProvider) => {
cert: z.string(),
lastUsed: z.date().nullable().optional(),
enableGroupSync: z.boolean().optional(),
- mfaSignalAttribute: z.string(),
+ mfaSignalAttribute: z.string().nullable().optional(),
mfaAuthnContexts: z.string().array().nullable().optional()
})
}
diff --git a/backend/src/ee/services/saml-config/saml-config-types.ts b/backend/src/ee/services/saml-config/saml-config-types.ts
index 2daf00ed3f..235607582e 100644
--- a/backend/src/ee/services/saml-config/saml-config-types.ts
+++ b/backend/src/ee/services/saml-config/saml-config-types.ts
@@ -20,7 +20,7 @@ export type TCreateSamlCfgDTO = {
issuer: string;
idpCert: string;
enableGroupSync?: boolean;
- mfaSignalAttribute?: string;
+ mfaSignalAttribute?: string | null;
mfaAuthnContexts?: string[] | null;
} & TOrgPermission;
@@ -31,7 +31,7 @@ export type TUpdateSamlCfgDTO = Partial<{
issuer: string;
idpCert: string;
enableGroupSync?: boolean;
- mfaSignalAttribute?: string;
+ mfaSignalAttribute?: string | null;
mfaAuthnContexts?: string[] | null;
}> &
TOrgPermission;
@@ -87,7 +87,7 @@ export type TSamlConfigServiceFactory = {
cert: string;
lastUsed: Date | null | undefined;
enableGroupSync?: boolean;
- mfaSignalAttribute: string;
+ mfaSignalAttribute?: string | null;
mfaAuthnContexts?: string[] | null;
}>;
samlLogin: (arg: TSamlLoginDTO) => Promise<TProviderAuthResult & { userId: string; orgId: string; orgName: string }>;
diff --git a/backend/src/lib/api-docs/constants.ts b/backend/src/lib/api-docs/constants.ts
index d7d63893ae..a180b449ff 100644
--- a/backend/src/lib/api-docs/constants.ts
+++ b/backend/src/lib/api-docs/constants.ts
@@ -4254,7 +4254,7 @@ export const SamlSso = {
enableGroupSync:
"Whether to enable automatic synchronization of group memberships from the SAML provider to Infisical groups.",
mfaSignalAttribute:
- "The SAML attribute that lists the authentication methods the user completed, such as an Okta attribute with value session.amr. Defaults to amr.",
+ "The SAML attribute that lists the authentication methods the user completed, such as an Okta attribute with value session.amr. Set to null to use the provider's default: http://schemas.microsoft.com/claims/authnmethodsreferences for Azure / Entra ID, amr for every other provider.",
mfaAuthnContexts:
"Additional AuthnContextClassRef values, besides the built-in two-factor classes, that prove the identity provider completed MFA."
},
@@ -4269,7 +4269,7 @@ export const SamlSso = {
enableGroupSync:
"Whether to enable automatic synchronization of group memberships from the SAML provider to Infisical groups.",
mfaSignalAttribute:
- "The SAML attribute that lists the authentication methods the user completed, such as an Okta attribute with value session.amr. Defaults to amr.",
+ "The SAML attribute that lists the authentication methods the user completed, such as an Okta attribute with value session.amr. Set to null to use the provider's default: http://schemas.microsoft.com/claims/authnmethodsreferences for Azure / Entra ID, amr for every other provider.",
mfaAuthnContexts:
"Additional AuthnContextClassRef values, besides the built-in two-factor classes, that prove the identity provider completed MFA."
},
diff --git a/backend/src/services/auth/idp-mfa-signal.test.ts b/backend/src/services/auth/idp-mfa-signal.test.ts
index a6fc0c7e0b..10dc24b629 100644
--- a/backend/src/services/auth/idp-mfa-signal.test.ts
+++ b/backend/src/services/auth/idp-mfa-signal.test.ts
@@ -54,14 +54,14 @@ describe("matchIdpMfaSignal for OIDC", () => {
const saml = (
authnContextClassRefs: string[],
attributes?: Record<string, unknown>,
- config?: { mfaSignalAttribute?: string; mfaAuthnContexts?: string[] }
+ config?: { authProvider?: string; mfaSignalAttribute?: string; mfaAuthnContexts?: string[] }
) => matchIdpMfaSignal({ kind: "saml", authnContextClassRefs, attributes, config });
describe("matchIdpMfaSignal for SAML", () => {
test.each([
- ["Entra ID Authenticator", "urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract"],
- ["Entra ID TOTP", "urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken"],
- ["Entra ID passkey", "urn:oasis:names:tc:SAML:2.0:ac:classes:SmartcardPKI"],
+ ["MobileTwoFactorContract", "urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract"],
+ ["TimeSyncToken", "urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken"],
+ ["Entra ID passkey (SmartcardPKI)", "urn:oasis:names:tc:SAML:2.0:ac:classes:SmartcardPKI"],
["REFEDS MFA profile", "https://refeds.org/profile/mfa"],
["Entra ID multipleauthn context", MULTIPLEAUTHN]
])("accepts the %s context class", (_, classRef) => {
@@ -91,18 +91,31 @@ describe("matchIdpMfaSignal for SAML", () => {
expect(saml([], { AMR: "mfa" })).toMatchObject({ verified: true, evidence: ["AMR=mfa"] });
});
- test("reads the Entra ID authnmethodsreferences attribute when the configuration names it", () => {
- const attributes = {
- [AUTHN_METHODS_REFERENCES]: [
- "http://schemas.microsoft.com/ws/2008/06/identity/authenticationmethod/password",
- MULTIPLEAUTHN
- ]
- };
+ describe("default attribute per provider", () => {
+ const passwordMethod = "http://schemas.microsoft.com/ws/2008/06/identity/authenticationmethod/password";
const passwordClass = "urn:oasis:names:tc:SAML:2.0:ac:classes:Password";
- expect(saml([passwordClass], attributes).verified).toBe(false);
- expect(saml([passwordClass], attributes, { mfaSignalAttribute: AUTHN_METHODS_REFERENCES })).toMatchObject({
- verified: true,
- evidence: [`${AUTHN_METHODS_REFERENCES}=${MULTIPLEAUTHN}`]
+ const entraPush = { [AUTHN_METHODS_REFERENCES]: [passwordMethod, MULTIPLEAUTHN] };
+
+ // Entra ID reports a push or TOTP login as Password in AuthnContextClassRef.
+ test("reads authnmethodsreferences for an Entra ID config with no attribute set", () => {
+ expect(saml([passwordClass], entraPush, { authProvider: "azure-saml" })).toMatchObject({
+ verified: true,
+ evidence: [`${AUTHN_METHODS_REFERENCES}=${MULTIPLEAUTHN}`]
+ });
+ expect(
+ saml([passwordClass], { [AUTHN_METHODS_REFERENCES]: [passwordMethod] }, { authProvider: "azure-saml" }).verified
+ ).toBe(false);
+ });
+
+ test("reads amr, not authnmethodsreferences, for every other provider", () => {
+ expect(saml([passwordClass], entraPush, { authProvider: "okta-saml" }).verified).toBe(false);
+ expect(saml([], { amr: ["mfa"] }, { authProvider: "okta-saml" }).verified).toBe(true);
+ });
+
+ test("an attribute set on the config overrides the provider default", () => {
+ expect(
+ saml([], { amr: ["mfa"], ...entraPush }, { authProvider: "azure-saml", mfaSignalAttribute: "amr" })
+ ).toMatchObject({ verified: true, evidence: ["amr=mfa"] });
});
});
diff --git a/backend/src/services/auth/idp-mfa-signal.ts b/backend/src/services/auth/idp-mfa-signal.ts
index 3bdc294232..8dff1aa59d 100644
--- a/backend/src/services/auth/idp-mfa-signal.ts
+++ b/backend/src/services/auth/idp-mfa-signal.ts
@@ -1,6 +1,12 @@
// "amr" is the OIDC Core claim name. SAML has no standard attribute name, so the Okta convention is the default.
const DEFAULT_MFA_CLAIM_NAME = "amr";
+// Entra ID reports a push or TOTP login as Password in AuthnContextClassRef and puts multipleauthn only in this
+// attribute, which it sends without configuration, so it is the default for Entra configs.
+const SAML_PROVIDER_MFA_SIGNAL_ATTRIBUTES: Record<string, string> = {
+ "azure-saml": "http://schemas.microsoft.com/claims/authnmethodsreferences"
+};
+
// RFC 8176 value for a completed multi-factor login; Okta, Entra ID, Auth0, Google and Duo all emit it.
const DEFAULT_OIDC_MFA_CLAIM_VALUES = ["mfa"];
@@ -33,6 +39,7 @@ export type TIdpMfaSignal = {
};
type TSamlMfaSignalConfig = {
+ authProvider?: string | null;
mfaSignalAttribute?: string | null;
mfaAuthnContexts?: string[] | null;
};
@@ -89,7 +96,10 @@ export const matchIdpMfaSignal = (input: TIdpMfaSignalInput): TIdpMfaSignal => {
const evidence = matchingValues(receivedContexts, acceptedContexts);
const attributes = input.attributes ?? {};
- const attributeName = input.config?.mfaSignalAttribute?.trim() || DEFAULT_MFA_CLAIM_NAME;
+ const attributeName =
+ input.config?.mfaSignalAttribute?.trim() ||
+ SAML_PROVIDER_MFA_SIGNAL_ATTRIBUTES[input.config?.authProvider ?? ""] ||
+ DEFAULT_MFA_CLAIM_NAME;
const attributeKey = findKey(attributes, attributeName);
const receivedAttributeValues = attributeKey ? toStringList(attributes[attributeKey]) : [];
matchingValues(receivedAttributeValues, SAML_MFA_ATTRIBUTE_VALUES).forEach((value) => {
diff --git a/docs/documentation/platform/mfa.mdx b/docs/documentation/platform/mfa.mdx
index 36dc0dfed7..2ae13339d2 100644
--- a/docs/documentation/platform/mfa.mdx
+++ b/docs/documentation/platform/mfa.mdx
@@ -24,7 +24,7 @@ If your organization enforces MFA and your users sign in through [SAML or OIDC S
Infisical trusts a login only if the identity provider's signed response says MFA was completed:
- For OIDC, the ID token's `amr` claim includes `mfa`
-- For SAML, the assertion's authentication context is a two-factor class, such as `MobileTwoFactorContract` or `TimeSyncToken`, or the `amr` attribute statement includes `mfa`
+- For SAML, the assertion's authentication context is a two-factor class, such as `MobileTwoFactorContract` or `TimeSyncToken`, or the MFA attribute includes `mfa` or `multipleauthn` (Infisical reads `authnmethodsreferences` for Entra ID and `amr` for every other provider)
Without a signal, Infisical prompts as usual. The `user-login` event in the [audit log](/documentation/platform/audit-logs#event-types) shows the values the identity provider sent, so you can see why a login was or wasn't prompted.
diff --git a/docs/documentation/platform/sso/azure.mdx b/docs/documentation/platform/sso/azure.mdx
index 47d2c20c09..c660f1072b 100644
--- a/docs/documentation/platform/sso/azure.mdx
+++ b/docs/documentation/platform/sso/azure.mdx
@@ -63,7 +63,7 @@ description: "Learn how to configure Microsoft Entra ID for Infisical SSO."
![Azure SAML edit attributes and claims 2](../../../images/sso/azure/edit-attributes-claims-2.png)
- Entra ID reports the sign-in method in the assertion's authentication context, so you can let Infisical trust the MFA your users complete in Entra ID without adding a claim. See [MFA for SSO logins](/documentation/platform/mfa#mfa-for-sso-logins).
+ Entra ID includes the `authnmethodsreferences` claim in the assertion, and Infisical reads that claim for Entra ID by default, so you can let Infisical trust the MFA your users complete in Entra ID without adding a claim. See [MFA for SSO logins](/documentation/platform/mfa#mfa-for-sso-logins).
Back in the **Set up Single Sign-On with SAML** screen, select **Edit** in the **SAML Certificates** section and set the **Signing Option** field to **Sign SAML response and assertion**.
diff --git a/frontend/src/hooks/api/ssoConfig/queries.tsx b/frontend/src/hooks/api/ssoConfig/queries.tsx
index b46dc98334..c9a41587d4 100644
--- a/frontend/src/hooks/api/ssoConfig/queries.tsx
+++ b/frontend/src/hooks/api/ssoConfig/queries.tsx
@@ -48,7 +48,7 @@ export const useCreateSSOConfig = () => {
issuer: string;
cert: string;
enableGroupSync?: boolean;
- mfaSignalAttribute?: string;
+ mfaSignalAttribute?: string | null;
mfaAuthnContexts?: string[] | null;
}) => {
const { data } = await apiRequest.post("/api/v1/sso/config", {
@@ -94,7 +94,7 @@ export const useUpdateSSOConfig = () => {
issuer?: string;
cert?: string;
enableGroupSync?: boolean;
- mfaSignalAttribute?: string;
+ mfaSignalAttribute?: string | null;
mfaAuthnContexts?: string[] | null;
}) => {
const { data } = await apiRequest.patch("/api/v1/sso/config", {
diff --git a/frontend/src/pages/organization/SettingsPage/components/OrgSsoTab/SSOModal.tsx b/frontend/src/pages/organization/SettingsPage/components/OrgSsoTab/SSOModal.tsx
index d84c02dd6c..64bc156046 100644
--- a/frontend/src/pages/organization/SettingsPage/components/OrgSsoTab/SSOModal.tsx
+++ b/frontend/src/pages/organization/SettingsPage/components/OrgSsoTab/SSOModal.tsx
@@ -159,18 +159,18 @@ const providerLabels = (authProvider: string): TProviderLabels => {
}
};
+const providerMfaSignalAttribute = (authProvider: string) =>
+ authProvider === AuthProvider.AZURE_SAML
+ ? "http://schemas.microsoft.com/claims/authnmethodsreferences"
+ : "amr";
+
const schema = z
.object({
authProvider: z.string().min(1, "SSO Type is required"),
entryPoint: z.string().trim().min(1, "URL required"),
issuer: z.string().trim().min(1, "Issuer required"),
cert: z.string().default(""),
- mfaSignalAttribute: z
- .string()
- .trim()
- .min(1, "Attribute name is required")
- .max(512, "Attribute name is too long")
- .default("amr"),
+ mfaSignalAttribute: z.string().trim().max(512, "Attribute name is too long").default(""),
mfaAuthnContexts: z
.array(z.string().trim().min(1).max(512, "Context value is too long"))
.max(20, "At most 20 contexts")
@@ -201,7 +201,7 @@ export const SSOModal = ({ popUp, handlePopUpClose, handlePopUpToggle, hideDelet
const { control, handleSubmit, reset, watch, setValue, getValues } = useForm<AddSSOFormData>({
defaultValues: {
authProvider: AuthProvider.OKTA_SAML,
- mfaSignalAttribute: "amr",
+ mfaSignalAttribute: "",
mfaAuthnContexts: []
},
resolver: zodResolver(schema)
@@ -214,7 +214,7 @@ export const SSOModal = ({ popUp, handlePopUpClose, handlePopUpToggle, hideDelet
entryPoint: data?.entryPoint ?? "",
issuer: data?.issuer ?? "",
cert: data?.cert ?? "",
- mfaSignalAttribute: data?.mfaSignalAttribute || "amr",
+ mfaSignalAttribute: data?.mfaSignalAttribute ?? "",
mfaAuthnContexts: data?.mfaAuthnContexts ?? []
});
}
@@ -249,7 +249,7 @@ export const SSOModal = ({ popUp, handlePopUpClose, handlePopUpToggle, hideDelet
if (!currentOrg) return;
const mfaSignal = {
- mfaSignalAttribute,
+ mfaSignalAttribute: mfaSignalAttribute || null,
mfaAuthnContexts: mfaAuthnContexts.length > 0 ? mfaAuthnContexts : null
};
const payload = {
@@ -442,18 +442,20 @@ export const SSOModal = ({ popUp, handlePopUpClose, handlePopUpToggle, hideDelet
name="mfaSignalAttribute"
render={({ field, fieldState: { error } }) => (
<Field>
- <FieldLabel htmlFor="sso-mfa-signal-attribute">MFA Attribute Name</FieldLabel>
+ <FieldLabel htmlFor="sso-mfa-signal-attribute">
+ MFA Attribute Name (Optional)
+ </FieldLabel>
<Input
id="sso-mfa-signal-attribute"
className="font-mono"
- placeholder="amr"
+ placeholder={providerMfaSignalAttribute(authProvider)}
autoComplete="off"
isError={Boolean(error)}
{...field}
/>
<FieldDescription>
Attribute in the {providerName} SAML assertion that lists the authentication
- methods the user completed.
+ methods the user completed. Leave empty to use the {providerName} default.
</FieldDescription>
<FieldError>{error?.message}</FieldError>
</Field>