Skip to content

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

remove single code

Thiago Araujo da Silvaa33c2310486e
diff --git a/backend/AGENTS.md b/backend/AGENTS.md
index 35606dfa4a..6174c2e34c 100644
--- a/backend/AGENTS.md
+++ b/backend/AGENTS.md
@@ -303,7 +303,7 @@ Token detection logic in `inject-identity.ts` checks `x-api-key` header first, t
org's MFA enforcement with the MFA the IdP already performed. The SAML and OIDC callbacks derive one verdict
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
+two factors (possession-only classes such as `Smartcard`, `SoftwarePKI` and `TimeSyncToken` are not defaults), or 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
diff --git a/backend/src/services/auth/idp-mfa-signal.test.ts b/backend/src/services/auth/idp-mfa-signal.test.ts
index 10dc24b629..582088e66c 100644
--- a/backend/src/services/auth/idp-mfa-signal.test.ts
+++ b/backend/src/services/auth/idp-mfa-signal.test.ts
@@ -60,7 +60,6 @@ const saml = (
describe("matchIdpMfaSignal for SAML", () => {
test.each([
["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]
@@ -74,6 +73,7 @@ describe("matchIdpMfaSignal for SAML", () => {
["Password", "urn:oasis:names:tc:SAML:2.0:ac:classes:Password"],
["possession-only Smartcard", "urn:oasis:names:tc:SAML:2.0:ac:classes:Smartcard"],
["possession-only SoftwarePKI", "urn:oasis:names:tc:SAML:2.0:ac:classes:SoftwarePKI"],
+ ["possession-only TimeSyncToken", "urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken"],
["unspecified", "urn:oasis:names:tc:SAML:2.0:ac:classes:unspecified"]
])("rejects the single-factor %s context class", (_, classRef) => {
expect(saml([classRef]).verified).toBe(false);
diff --git a/backend/src/services/auth/idp-mfa-signal.ts b/backend/src/services/auth/idp-mfa-signal.ts
index 8dff1aa59d..f3ac92d3d8 100644
--- a/backend/src/services/auth/idp-mfa-signal.ts
+++ b/backend/src/services/auth/idp-mfa-signal.ts
@@ -10,14 +10,13 @@ const SAML_PROVIDER_MFA_SIGNAL_ATTRIBUTES: Record<string, string> = {
// 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"];
-// Only classes whose definition asserts two factors: SmartcardPKI is a card plus a PIN and TimeSyncToken a
-// PIN plus a token code, alongside MobileTwoFactorContract, the REFEDS MFA profile and Entra ID's
-// satisfied-MFA class. Possession-only classes such as Smartcard and SoftwarePKI, and single-factor ones such
-// as PasswordProtectedTransport and MobileTwoFactorUnregistered, are deliberately absent; an org that knows
-// its IdP only issues them after MFA adds them to `mfaAuthnContexts`.
+// Only classes whose definition asserts two factors: SmartcardPKI's schema requires a card plus an
+// ActivationPin, alongside MobileTwoFactorContract, the REFEDS MFA profile and Entra ID's satisfied-MFA class.
+// Possession-only classes such as Smartcard, SoftwarePKI and TimeSyncToken (its schema requires only the token),
+// and single-factor ones such as PasswordProtectedTransport and MobileTwoFactorUnregistered, are deliberately
+// absent; an org that knows its IdP only issues them after MFA adds them to `mfaAuthnContexts`.
const DEFAULT_SAML_MFA_AUTHN_CONTEXTS = [
"urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract",
- "urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken",
"urn:oasis:names:tc:SAML:2.0:ac:classes:SmartcardPKI",
"https://refeds.org/profile/mfa",
"http://schemas.microsoft.com/claims/multipleauthn"
diff --git a/docs/documentation/platform/mfa.mdx b/docs/documentation/platform/mfa.mdx
index 2ae13339d2..e4d21f158c 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 MFA attribute includes `mfa` or `multipleauthn` (Infisical reads `authnmethodsreferences` for Entra ID and `amr` for every other provider)
+- For SAML, the assertion's authentication context is a two-factor class, such as `MobileTwoFactorContract` or `SmartcardPKI`, 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.