Basic information
About clerk-enterprise-rbac
Configure enterprise SSO, role-based access control, and organization management. Use when implementing SSO integration, configuring role-based permissions, or setting up organization-level controls. Trigger with phrases like "clerk SSO", "clerk RBAC", "clerk enterprise", "clerk roles", "clerk permissions", "clerk SAML".
clerk-enterprise-rbac is an agent skill listed in the AddMCP.net directory, published by jeremylongshore. Runtime: Python. License: MIT. The repository has 2,889 GitHub stars. Source code is hosted on github.com. Related topics: agent-skills, ai, ai-agents, anthropic, automation.
Overview
What is clerk-enterprise-rbac?
name: clerk-enterprise-rbac description: | Configure enterprise SSO, role-based access control, and organization management. Use when implementing SSO integration, configuring role-based permissions, or setting up organization-level controls. Trigger with phrases like "clerk SSO", "clerk RBAC", "clerk enterprise", "clerk roles", "clerk permissions", "clerk organizations". allowed-tools: Read, Write, Edit, Grep version: 1.0.0 license: MIT author: Jeremy Longshore <[email protected]> compatible-with: claude-code, codex, openclaw tags: [saas, clerk, rbac, enterprise, organizations]
Clerk Enterprise RBAC
Overview
Implement enterprise-grade role-based access control, organization management, and SSO with Clerk. Covers custom roles and permissions, organization lifecycle, multi-tenant access patterns, SAML/OIDC SSO, and the Backend API for programmatic role management (released Nov 2025).
Prerequisites
- Clerk Pro or Enterprise plan (Organizations + SSO require paid plan)
- Organizations feature enabled in Clerk Dashboard > Organizations > Settings
- Next.js 14+ with App Router (examples use
@clerk/nextjs)
Instructions
Select Organization
Admin Panel
Current role: {orgRole}
{organization?.name}
{/* Declarative: Protect component with fallback */} You need admin access to view this section.} > {/* Permission-based rendering */} {/* Imperative: has() for conditional logic */} {has?.({ permission: 'org:analytics:read' }) && ( )}Error Handling
| Error | Cause | Solution | |-------|-------|----------| | orgId is null | No active organization | Redirect to org selector, show <OrganizationSwitcher /> | | has() returns false | Role/permission not assigned | Check assignment in Dashboard > Organizations > Members | | Permission denied on middleware | User lacks required role | Verify route matcher maps to correct role | | SSO login fails | Misconfigured IdP metadata | Verify ACS URL and Entity ID in IdP settings | | Invitation fails | Email already a member | Check membership before inviting | | Custom role not visible | Created via API, not Dashboard | Roles created via API are org-scoped, not instance-wide |
Enterprise Considerations
- Roles and permissions are embedded in the session JWT -- no extra network requests needed for authorization checks
- Custom roles created in the Dashboard are instance-wide; roles created via Backend API are organization-scoped
- For multi-tenant SaaS, combine Organizations with tenant-scoped database queries (
WHERE org_id = :orgId) - Session claims include
org_id,org_role, andorg_permissions-- available in middleware without API calls - Verified domains + SAML SSO enable "just-in-time provisioning" -- users auto-join the org on first SSO sign-in
- Consider the
org:sys_*system permissions (sys_memberships:manage,sys_memberships:read,sys_domains:manage) for built-in org management actions
Next Steps
Proceed to clerk-migration-deep-dive for auth provider migration.
Comments
No comments yet
Be the first to share feedback about this listing. Sign in to leave a comment.
Sign In