Twenty CRM OAuth Mastery Skill for Openclaw

A comprehensive technical resource for implementing, debugging, and optimizing OAuth 2.0 authentication and data synchronization in Twenty CRM.

avirweb
v1.0.0
Feb 9, 2026
0
1.9k
0

Install & Download

1. ClawHub CLI

The fastest way to install a skill directly from the registry.

npx clawhub@latest install twenty-oauth-mastery

2. Manual Installation

Copy the skill folder to one of these locations

Global
~/.openclaw/skills/
Workspace
<project>/skills/

Priority: Workspace > Local > Bundled

3. Prompt Installation

Copy this prompt to OpenClaw to install it automatically.

Help me install twenty-oauth-mastery using Clawhub. If Clawhub is not installed, install it first (npm i -g clawhub).

Prefer to download?

Get the raw skill files in a ZIP archive.

What is Twenty CRM OAuth Mastery Skill?

This skill provides deep technical expertise for developers working with Twenty CRM, focusing specifically on the complex OAuth 2.0 lifecycle. It bridges the gap between basic authentication and production-grade features like automated Gmail and Calendar synchronization. By utilizing this resource within Openclaw Skills, developers can ensure secure, reliable token management and domain-restricted access control.

The content covers the entire stack from NestJS backend strategies to frontend token processing effects. It is designed to help teams resolve common production hurdles such as redirect loops, missing sync triggers, and complex domain validation rules, ensuring a seamless user onboarding experience for self-hosted and cloud-managed CRM instances.

Twenty CRM OAuth Mastery Skill Use Cases

  • Implementing new OAuth providers like Google or Microsoft for CRM access.
  • Resolving persistent redirect loops after successful user authentication.
  • Configuring multi-domain restrictions to limit access to specific corporate emails (e.g., .com and .co).
  • Automating the setup of email and calendar synchronization immediately after login.
  • Debugging token refresh failures and handling expired session states gracefully.

How Twenty CRM OAuth Mastery Skill Works

  1. Configures Passport strategies with critical request state parameters like passReqToCallback.
  2. Preserves access and refresh tokens during the validation phase to enable background services.
  3. Triggers the OAuthSyncService to initialize message and calendar channels before the final redirect.
  4. Manages frontend side-effects using token signatures to prevent infinite processing loops.
  5. Validates session state against database-stored workspace metadata and domain allowlists to enforce security.

Twenty CRM OAuth Mastery Skill Setup

Configure your environment with the necessary provider credentials and enable synchronization modules in your environment file.

# Set up Google OAuth environment variables
export AUTH_GOOGLE_ENABLED=true
export AUTH_GOOGLE_CLIENT_ID=your-client-id
export AUTH_GOOGLE_CLIENT_SECRET=your-client-secret
export AUTH_GOOGLE_CALLBACK_URL=https://yourdomain.com/auth/google/redirect

# Enable Sync Providers
export CALENDAR_PROVIDER_GOOGLE_ENABLED=true
export MESSAGING_PROVIDER_GMAIL_ENABLED=true

# Rebuild the server to apply changes
npx nx build twenty-server
docker restart twenty-container

Twenty CRM OAuth Mastery Skill Data Schema & Taxonomy

The skill manages data across specific directory structures and database tables to maintain authentication state and sync configurations.

Component Type Description
auth/strategies Directory Contains Passport.js implementation for Google and Microsoft.
workspaceMetadata DB Table Stores approved access domains and workspace-level auth settings.
connectedAccount DB Table Maps users to their OAuth tokens and provider handles.
messageChannel DB Table Tracks the status and progress of email synchronization tasks.

Twenty CRM OAuth Mastery Skill Advanced Features

  • Multi-domain allowlist support for complex corporate structures including .co and .io TLDs.
  • Automatic Gmail and Calendar channel provisioning upon successful SSO login.
  • Intelligent token refresh logic that preserves original refresh tokens when providers do not issue new ones.
  • Strategic error parsing for Google OAuth to distinguish between retryable rate limits and fatal invalid_grant errors.
  • Automated testing patterns for validating cookie injection and frontend token processing using Playwright.

SKILL.md


Loading

Related Openclaw Skills

METADATA

Github Stars: 0
forks: 0

Featured*