Documentation Index
Fetch the complete documentation index at: https://mintlify.com/zitadel/zitadel/llms.txt
Use this file to discover all available pages before exploring further.
Overview
ZITADEL implements Role-Based Access Control (RBAC) with fine-grained permissions that respect the multi-tenant hierarchy. Authorization is tightly integrated with the hierarchical model:Core Authorization Concepts
Roles
Roles are named collections of permissions defined at the project level.- Project-scoped: Roles are created within a specific project
- Custom definitions: You define role names and their meanings
- No built-in permissions: ZITADEL doesn’t dictate what roles mean — you implement the logic in your application
- Included in tokens: Roles are added to ID tokens and access tokens
ZITADEL provides the infrastructure for roles but doesn’t enforce authorization logic. Your application reads roles from tokens and implements the actual access control.
Role Grants
A Role Grant assigns a role to a user within a specific context:- User + Role + Context: Who has which role, in what scope
- Organization-scoped: Grants are specific to an organization
- Project-scoped: Grants apply to a specific project
Permissions
Permissions are fine-grained capabilities required to perform specific API operations.- Instance-level permissions: For managing instance settings (e.g.,
iam.web_key.write) - Organization-level permissions: For managing resources in an organization (e.g.,
user.write) - Checked by ZITADEL: API endpoints automatically verify required permissions
Permission Annotations in Proto Definitions
Permission Annotations in Proto Definitions
API endpoints declare required permissions in protobuf:When a user calls this API:
- ZITADEL checks if the user has the
iam.web_key.writepermission - If yes, the request proceeds
- If no, returns
403 Forbidden
How Authorization Works
1. Define Roles in Your Project
Create roles that make sense for your application:- Via Console
- Via API
- Navigate to your Project
- Click Roles
- Click New Role
- Enter role name (e.g.,
admin,member,viewer) - Optionally add a display name and description
- Click Save
2. Grant Roles to Users
Assign roles to users within an organization:- Via Console
- Via API
- Navigate to Organizations → Select organization
- Click Users → Select user
- Click Authorizations tab
- Click New
- Select the project and role(s)
- Click Save
3. Roles Appear in Tokens
When a user authenticates, their roles are included in the tokens:ID Token Example
The
urn:zitadel:iam:org:project:roles claim contains a nested structure:- Role key → Project ID → Project name
4. Your Application Enforces Authorization
Your backend reads roles from tokens and implements access control:Administrative Roles
ZITADEL has built-in administrative roles for managing the platform itself:IAM Owners (Instance Admins)
Scope: Entire instance Capabilities:- Manage instance settings and policies
- Create and manage organizations
- View audit logs across all organizations
- Configure identity providers
- Manage instance branding
Organization Managers (Org Admins)
Scope: Specific organization Capabilities:- Manage users within the organization
- Create and manage projects
- Assign roles to users
- Configure organization branding
- View organization audit logs
Project Owners
Scope: Specific project Capabilities:- Manage applications in the project
- Define and modify roles
- Grant project access to other organizations
- Configure project settings
Project Grants
Project Grants allow you to share a project with users from other organizations.Use Case: B2B Partner Access
Your SaaS company (Organization A) wants to give a partner company (Organization B) limited access to your application:- Via Console
- Via API
- Navigate to your Project
- Click Granted Organizations
- Click New
- Select Organization B
- Select which roles to grant (e.g., only
viewer) - Click Save
viewer role in your project.Project grants enable delegated role management: Organization B admins can assign the
viewer role to their own users without involving Organization A.Authorization with APIs
ZITADEL APIs have built-in authorization checks:Permission-Based Authorization
Some endpoints require specific permissions:user.write permission in the target organization.
Authenticated-Only Endpoints
Other endpoints only require authentication:Context-Based Authorization
Some endpoints check permissions based on the requested resource:- Reading own user: No special permission required
- Reading other users: Requires
user.readpermission in the user’s organization - Updating own user: No special permission required
- Updating other users: Requires
user.writepermission
Example: User Read Authorization
Example: User Read Authorization
SCIM for Role Management
ZITADEL supports SCIM 2.0 for automated user and role provisioning:- Provision users: Create users from external identity systems
- Assign roles: Map groups to ZITADEL roles
- Sync changes: Keep user data and roles in sync
SCIM User with Roles
Actions for Custom Authorization
Actions allow you to customize authorization logic:Token Enrichment
Add custom claims to tokens based on your business logic:Action: Add Department to Token
Pre-Authorization Checks
Block authentication based on custom criteria:Action: Require Email Verification
Best Practices
Role Naming
Role Naming
- Use lowercase names:
admin,member,viewer - Be descriptive:
billing_admininstead ofba - Consistent naming across projects
- Document what each role means
Least Privilege Principle
Least Privilege Principle
- Grant minimum necessary roles
- Use viewer/read-only roles by default
- Require justification for admin roles
- Regularly audit role assignments
Separation of Concerns
Separation of Concerns
- ZITADEL manages: Authentication, role storage, token issuance
- Your app manages: Role interpretation, feature access, data filtering
Testing Authorization
Testing Authorization
Performance
Performance
- Cache role checks in your application
- Don’t make API calls on every authorization check
- Validate tokens locally using JWKS
- Use short-lived tokens to ensure fresh role data
Next Steps
Roles Guide
Create and manage roles for your projects
Actions
Customize token claims and add business logic
SCIM Integration
Automate user and role provisioning
API Authentication
Understand API permissions and authentication