bitwarden/server · error · Exception
OrganizationUserAccessRevoked
Error message
OrganizationUserAccessRevoked
What it means
Thrown by EnforceAllowedOrgUserStatus when an organization user's status is Revoked and 'Revoked' is not in the allowed-statuses list for the current SSO operation. Revoked users are explicitly blocked from being auto-provisioned or completing SSO login. The organization display name is included in the message for logging context.
Source
Thrown at bitwarden_license/src/Sso/Controllers/AccountController.cs:889
}
private void EnforceAllowedOrgUserStatus(
OrganizationUserStatusType statusToCheckAgainst,
OrganizationUserStatusType[] allowedStatuses,
string organizationDisplayNameForLogging)
{
// if this status is one of the allowed ones, just return
if (allowedStatuses.Contains(statusToCheckAgainst))
{
return;
}
// otherwise throw the appropriate exception
switch (statusToCheckAgainst)
{
case OrganizationUserStatusType.Revoked:
// Revoked users may not be (auto)‑provisioned
throw new Exception(
_i18nService.T("OrganizationUserAccessRevoked", organizationDisplayNameForLogging));
default:
// anything else is “unknown”
throw new Exception(
_i18nService.T("OrganizationUserUnknownStatus", organizationDisplayNameForLogging));
}
}
private IActionResult InvalidJson(string errorMessageKey, Exception? ex = null)
{
Response.StatusCode = ex == null ? 400 : 500;
return Json(new ErrorResponseModel(_i18nService.T(errorMessageKey))
{
ExceptionMessage = ex?.Message,
ExceptionStackTrace = ex?.StackTrace,
InnerExceptionMessage = ex?.InnerException?.Message,
});
}View on GitHub (pinned to e93b962371)
Solutions
- Have an organization admin restore (un-revoke) the user's organization membership before SSO login is attempted.
- If the revocation was intentional, communicate to the user that their access has been revoked.
- Check the OrganizationUser table for the user's current Status to confirm it is Revoked (value 2) before re-inviting.
- Re-invite the user through the admin console to reset their status to Invited.
Defensive patterns
Strategy: validation
Validate before calling
// Check org user status before attempting SSO login
var orgUser = await organizationUserRepository.GetByOrganizationUserAsync(orgId, userId);
if (orgUser?.Status == OrganizationUserStatusType.Revoked)
{
return Forbid("User access has been revoked. Contact an organization admin.");
} Type guard
static bool IsRevokedOrgUser(OrganizationUser? ou)
=> ou?.Status == OrganizationUserStatusType.Revoked; Try / catch
try { await loginService.SsoLoginAsync(user, provider); }
catch (Exception ex) when (ex.Message.Contains("OrganizationUserAccessRevoked"))
{ /* Redirect to a 'your access has been revoked' page with a contact-admin message */ } Prevention
- Display the user's org membership status in the admin console before they attempt SSO.
- When revoking a user, notify them that SSO login will no longer work.
- Build a pre-login status check endpoint so clients can show a clear message before SSO redirect.
When it happens
Trigger: A user whose OrganizationUser.Status == Revoked attempts to log in via SSO. This can occur during the login status check (PreventOrgUserLoginIfStatusInvalidAsync) where allowed statuses are Invited, Accepted, or Confirmed — Revoked is not among them.
Common situations: An admin revoked the user's access, but the user still has an active SSO session or bookmarked SSO URL. The user was revoked as part of offboarding but attempts to authenticate before being re-invited.
Related errors
- OrganizationUserUnknownStatus
- InvalidUserIdentifier
- UserIdAndTokenMismatch
- SSOProviderIsNotAnOrgId
- CouldNotFindOrganization
AI-assisted analysis of bitwarden/server@e93b962371 (2026-08-13).
Data as JSON: /api/errors/e38375e9a065fa06.
Report an issue: GitHub.