Skip to content

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

reject locked account

Thiago Araujo da Silva1abd938e10e6
diff --git a/backend/src/services/oauth-client/oauth-client-service.ts b/backend/src/services/oauth-client/oauth-client-service.ts
index 084c304e73..d2b7f2118f 100644
--- a/backend/src/services/oauth-client/oauth-client-service.ts
+++ b/backend/src/services/oauth-client/oauth-client-service.ts
@@ -561,6 +561,19 @@ export const oauthClientServiceFactory = ({
throw new UnauthorizedError({ message: "The user this token identifies no longer has an Infisical account." });
}
+ if (!user.isAccepted) {
+ throw new UnauthorizedError({
+ message: "The user this token identifies has not completed Infisical account setup."
+ });
+ }
+
+ if (user.isLocked || (user.temporaryLockDateEnd && new Date() < user.temporaryLockDateEnd)) {
+ throw new UnauthorizedError({
+ message:
+ "The Infisical account for the user this token identifies is locked, so an application cannot act on their behalf. They can unlock it by resetting their password."
+ });
+ }
+
await permissionService.getOrgPermission({
actor: ActorType.USER,
actorId: user.id,
diff --git a/docs/documentation/platform/oauth-token-exchange.mdx b/docs/documentation/platform/oauth-token-exchange.mdx
index e0e0651ae4..9a3ac269de 100644
--- a/docs/documentation/platform/oauth-token-exchange.mdx
+++ b/docs/documentation/platform/oauth-token-exchange.mdx
@@ -185,6 +185,7 @@ Every exchange checks all of the following, and fails the request with a message
- The token **carries an `exp` claim and has not passed it**, and is not used before its `nbf` time. A token with no expiry is rejected rather than treated as valid forever.
- The **signing algorithm** matches your OIDC SSO configuration.
- The token's **subject** resolves to a user who has signed in through your organization's OIDC SSO and is an active member of the organization.
+- That user's **Infisical account is usable**: setup is complete and the account is not locked. A locked account fails the exchange outright rather than returning a token that stops working on first use.
- **MFA** requirements are satisfied, either because none apply or because the application declares that the identity provider enforces them.
## Audit trail