Authentication methods
Condo provides two primary sign-in mutations:| Mutation | Use case |
|---|---|
authenticateUserWithEmailAndPassword | Staff users and service integrations |
authenticateUserWithPhoneAndPassword | Staff and resident users with a phone-based account |
Sign in with email and password
Send the sign-in mutation. The A successful response:
dv and sender fields are required on all write operations. userType should be staff for human users or service for programmatic integrations.Attach the session to subsequent requests
The session is maintained in two ways simultaneously:Cookie (browser clients): The server sets a
Set-Cookie header on the sign-in response. Browsers and clients configured with credentials: 'include' send the cookie automatically on every subsequent request.Authorization header (server-to-server): Pass the token returned by the mutation in the Authorization header:Sign in with phone and password
For accounts created with phone numbers, useauthenticateUserWithPhoneAndPassword:
Phone numbers must be in E.164 format (e.g.
+79991234567). The dv, sender, and userType fields have defaults for the phone mutation and can be omitted.Service user accounts
For programmatic integrations that need persistent, non-human access, Condo supports service users (type: service). Service users can be created by admins via the registerNewServiceUser mutation:
password is generated server-side and returned directly in the response. Store it securely — it is not retrievable afterward via the API.
Service users authenticate with authenticateUserWithEmailAndPassword using userType: service:
Access control model
Every authenticated request is evaluated against two layers of access control:Organization scope
Queries and mutations are automatically filtered to records belonging to organizations where the user is a non-rejected, non-blocked employee.
Role-based permissions
The
OrganizationEmployee role controls fine-grained permissions: canManageTickets, canManageProperties, canManageEmployees, and more.UserRightsSet
Admins can grant specific users elevated rights (e.g.
canExecuteRegisterNewServiceUser) without full admin access.Admin override
Users with
isAdmin: true bypass organization-scoped filters and can access all records in the system.Two-factor authentication
If a user has 2FA enabled (isTwoFactorAuthenticationEnabled: true), the sign-in mutation returns a NOT_ENOUGH_AUTH_FACTORS error containing an authDetails object with availableSecondFactors and maskedData. Submit the secondFactor field with the OTP token on the second call:
Session configuration
Session secrets are configured via environment variables on the server. The cookie lifetime and secure flags follow standard Keystone 5 session configuration. For production deployments:- Set a strong
COOKIE_SECRETenvironment variable - Serve the API over HTTPS and set
secure: trueon the session cookie - Configure
sameSiteappropriately for your frontend origin