Authentication¶
MazeVault Authentication Methods and SSO Integration
Document Version: 1.0.0
Last Updated: 2026-02-10
1. Supported Authentication Methods¶
MazeVault supports multiple authentication methods to integrate with enterprise identity infrastructure:
| Method | Protocol | Use Case | License Tier |
|---|---|---|---|
| Local Authentication | Email + password (bcrypt), TOTP MFA (required by default) | Standalone deployments | All |
| LDAP / Active Directory | LDAP v3 | On-premise directory integration | Enterprise |
| Azure Entra ID | OpenID Connect | Azure/Microsoft 365 environments | Enterprise |
| OAuth 2.0 Client Credentials | OAuth 2.0 | Service-to-service (API) | All |
| MazeVault Agent Auth | mTLS + Bootstrap Token | Agent-to-server communication | All |
| API Token | Bearer Token | Programmatic API access | All |
2. Local Authentication¶
Local users sign in with their email address and password:
- The password is sent to
POST /api/v1/auth/loginover TLS and checked against a bcrypt hash (cost 12); MazeVault never stores the plaintext password - The endpoint is rate-limited, and every successful and failed attempt is written to the audit log (
LOGIN_SUCCESS,LOGIN_FAILED) - If the user has MFA set up, a TOTP code is required as a second step; a user who must set it up is taken to the setup first (see Multi-Factor Authentication)
- The response carries a short-lived access token; the refresh token is set as an HttpOnly cookie
Authentication Flow¶
sequenceDiagram
participant U as 🧑💻 User
participant C as 🌐 Client (Browser)
participant S as 🖥️ MazeVault API
rect rgb(235, 245, 251)
Note over U,C: Credential Entry
U->>C: Enter email + password
end
rect rgb(232, 245, 233)
Note over C,S: Password Check
C->>S: POST /auth/login (email, password)
S->>S: Verify bcrypt hash
end
rect rgb(255, 248, 225)
Note over C,S: Second Factor (if MFA is enabled)
S-->>C: 202 mfa_required + mfa_session_token
C->>S: POST /auth/mfa/verify (session_token, TOTP code)
end
S-->>C: Access token + refresh token cookie
Note over C,S: ✅ Signed in
3. SSO Integration¶
Azure Entra ID (OpenID Connect)¶
Configuration parameters required from your Azure tenant:
| Parameter | Description |
|---|---|
| Tenant ID | Azure AD tenant identifier |
| Client ID | Application registration client ID |
| Client Secret | Application registration secret |
| Redirect URI | Callback URL configured in MazeVault |
Supported features:
- Single Sign-On and Single Log-Out
- Automatic user provisioning on first login
- Group-to-role mapping
- Conditional access policy compatibility
- Optional check that the sign-in used MFA (see MFA for Entra ID Users)
LDAP / Active Directory¶
| Parameter | Description |
|---|---|
| Server URL | LDAP server address (ldaps:// recommended) |
| Bind DN | Service account distinguished name |
| Search Base | User search base DN |
| User Filter | LDAP filter for user lookup |
| Group Search Base | Group search base DN (optional) |
| TLS | Required for production (LDAPS or StartTLS) |
4. Multi-Factor Authentication (MFA)¶
MazeVault supports TOTP-based multi-factor authentication for local accounts:
- Compatible with Google Authenticator, Microsoft Authenticator, Authy, and other TOTP applications
- QR code-based enrollment; recovery (backup) codes are shown once after enrollment
- Every TOTP code and recovery code works only once
MFA Enforcement¶
Set in Organization Settings → Security → Multi-Factor Authentication. Users belong to no organization, so the setting applies to the whole installation; with several organizations the strictest one wins.
| Setting | Local accounts | Default |
|---|---|---|
| Required | Every local account, whatever its role, must set up MFA. After signing in without MFA set up, the user is taken to the MFA setup and can use nothing else until it is done. MFA cannot be disabled. | ✅ |
| Optional | Users can enable MFA themselves and disable it with the account password or a current TOTP / recovery code. |
A stored setting MazeVault cannot read counts as Required.
Lost authenticator: a user signs in with a recovery code. Without one, an administrator with role:write resets the
user's MFA in Access Control → Users → Reset MFA (POST /api/v1/rbac/users/{id}/mfa/reset, audited as
RESET_USER_MFA); the user is signed out and sets MFA up again at the next sign-in. The caller must be able to delete
the user, so nobody resets the MFA of a more powerful account, and nobody resets their own MFA (a stolen session could otherwise replace the second factor). Keep the recovery codes of the initial administrator safe:
nobody can reset the MFA of the only administrator.
MFA for Entra ID Users¶
Entra ID users never set up MFA in MazeVault; MFA is enforced in Entra ID with Conditional Access. With Require MFA
from Entra ID switched on (off by default), MazeVault refuses an Entra ID sign-in whose ID token does not list an MFA
method (mfa, ngcmfa, otp, hwk) in the amr claim, also when the claim is missing. If your tenant does not put
amr into the ID token, add it as an optional claim of the app registration (Token configuration) before switching
this on, or nobody can sign in through Entra ID.
The mfa_required Condition¶
A temporary access grant with the condition mfa_required applies only to a session that signed in with MFA: a local
account with MFA set up, or an Entra ID user whose last sign-in reported MFA in amr (whether or not Require MFA from
Entra ID is on). API tokens never satisfy it.
5. Session Management¶
| Parameter | Default | Configurable |
|---|---|---|
| Sign-in duration (absolute) | 24 hours | ✅ SESSION_MAX_LIFETIME |
| Idle timeout | 30 minutes | ✅ Organization Settings → Session Settings |
| Access token lifetime | 15 minutes | ✅ JWT_ACCESS_TOKEN_TTL |
| Concurrent sign-ins per user | 1 (a new sign-in ends the previous one) | — |
| Cookie Security | Secure; HttpOnly; SameSite=Lax (Secure with COOKIE_SECURE=true) |
— |
Tokens¶
- The access token is an HS256-signed JWT carrying the user ID, email, role and the time it was issued (
iat, in milliseconds). The web interface renews it with the refresh token cookie before it expires. - The refresh token is rotated on every renewal and carries the time of the interactive sign-in (
auth_time).SESSION_MAX_LIFETIMEafter the sign-in it is no longer renewed, however often it was used: the user signs in again.
Ending a sign-in¶
Every user has a revocation time (users.sessions_revoked_at). Each request with a user access token loads the user,
and a token issued before that time, a token of an archived user or a token without iat is refused with 401 and
code SESSION_REVOKED. The revocation time is set, the refresh token is cleared and the stored Entra ID tokens (used
for On-Behalf-Of) are deleted when:
- the user signs out,
- the user changes their password (the browser that changed it continues with a new refresh token),
- an administrator archives the user or resets the user's MFA,
- the user signs in again (one sign-in per user),
- Entra ID no longer signs the user in (see below).
API tokens (mvt_…) and agent tokens are not affected; an archived user's API tokens are switched off on archiving.
Entra ID account check¶
Every 5 minutes the backend redeems the stored Entra ID refresh token of every Entra ID user with a live sign-in.
When Entra ID refuses it (invalid_grant or interaction_required: account blocked or deleted, sessions revoked in
Entra ID, password changed, conditional access) or no Entra ID tokens are stored, the MazeVault sign-in ends at once.
Any other failure (network, Entra ID outage, a wrong client secret) ends it only at the third consecutive failed
check, so an outage does not sign everyone out. Each such end is audited as SESSION_REVOKED with the reason.
Local accounts are never checked.
Idle timeout¶
The web interface signs the user out after the organization's idle timeout without mouse, keyboard or touch activity (0 = 30 minutes). Background requests of an open page do not count as activity.
6. API Authentication¶
OAuth 2.0 Client Credentials¶
For service-to-service integrations:
POST /api/v1/auth/oauth2/token
Content-Type: application/x-www-form-urlencoded
grant_type=client_credentials
&client_id=<your-client-id>
&client_secret=<your-client-secret>
API Tokens (mvt_…)¶
A user creates API tokens with POST /api/v1/users/tokens (name, optional scopes and duration, default 24 h). scopes lists permissions such as secret:read, secret:* or *; a token with scopes acts only within them and within its owner's roles, and can create further tokens only within its own scopes. A token without scopes acts with all of its owner's rights.
Bearer Token Usage¶
All authenticated API requests use the obtained token:
7. Agent Authentication¶
MazeVault Agents use a bootstrap-then-certificate authentication flow:
sequenceDiagram
participant A as 🤖 Agent
participant S as 🖥️ MazeVault API
rect rgb(235, 245, 251)
Note over A,S: 🔑 Initial Registration
A->>S: POST /agents/register (bootstrap_token)
S-->>A: Agent ID + Client Certificate
end
rect rgb(232, 245, 233)
Note over A,S: 🔒 Ongoing Communication (mTLS)
A->>S: mTLS connection (client cert)
S->>S: Validate cert + extract agent ID
S-->>A: Authorized response
end
Related¶
- Security Overview — Security architecture
- Encryption — Cryptographic standards
- API Getting Started — API authentication examples