/cometchat-skills:cometchat-securityfrom cometchat-skills
Enterprise auth & access control for CometChat — SSO/OIDC/SAML via your own IdP, server-minted auth tokens, token revocation, and role-based access (RBAC app-wide roles + group scopes).
Ships in cometchat-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Ground truth: every REST shape here is FETCHED from the live docs —
{DOCS_BASE}/rest-api/auth-tokens,/rest-api/roles,/rest-api/rbac-overview,/rest-api/users,/rest-api/group-members(DOCS_BASE = https://www.cometchat.com/docs; append.mdfor the raw twin). CometChat is NOT an identity provider — it does not do SAML/OIDC for your end users. "SSO with CometChat" means your IdP authenticates the user, then your server mints a CometChat auth token for that user's UID. Verify signatures against the docs; never invent an endpoint.
Taking a CometChat integration through an enterprise security review: SSO with your IdP, role-based permissions, session revocation, multi-tenant isolation, or "make our chat secure/compliant to ship." Client-side login wiring itself lives in cometchat-<family>-core / -production; this skill owns the server + access-control model those depend on.
Three credentials, three homes — mixing them up is the #1 security defect:
| Credential | Who holds it | Purpose |
|---|---|---|
| Auth Key | client, dev only | quick login(uid) in development; can mint a session for ANY user — never ship it |
| Auth token | client, per user | production login with a per-user token — the call is per family (web/Angular/Android/Flutter loginWithAuthToken(token), iOS login(authToken:), React Native login({ authToken })); tied to one UID; revocable |
| REST API Key | server only | mint tokens, manage users/roles; full power — never in a client |
Production login is always auth token, never the Auth Key. Detail + the per-framework client call: cometchat-<family>-production.
CometChat rides on the identity you already have. The flow is the same whether your IdP is Okta, Auth0, Cognito, Entra ID, Google Workspace, or your own:
cometchat-migrate-from-* toCometChatId for the alpha-dash/≤100/lowercase rules) and, if the user is new, creates it (POST {DOCS_BASE}/rest-api/users, withAuthToken: true returns a token in the same call).POST /v3/users/{uid}/auth_tokens with the REST API Key ({DOCS_BASE}/rest-api/auth-tokens/create).loginWithAuthToken(token), iOS login(authToken:), React Native login({ authToken }) — see cometchat-<family>-production).The UID must come from the server session, never a request parameter. Accepting ?uid= lets any caller impersonate anyone — the single most common CometChat auth hole.
POST https://{APP_ID}.api-{REGION}.cometchat.io/v3/users/{uid}/auth_tokens
apikey: {REST_API_KEY} # server-side secret
content-type: application/json
Auth tokens do not expire by default and CometChat keeps a rolling 100 per user (oldest auto-archived). For enterprise session control:
DELETE /v3/users/{uid}/auth_tokens/{authToken}.DELETE /v3/users/{uid}/auth_tokens (flush all).{DOCS_BASE}/rest-api/auth-tokens/{delete,flush}.CometChat has two layers; an action must pass both or the API returns ERR_PERMISSION_DENIED:
| Layer | Scope | Set via | Use it for |
|---|---|---|---|
| Role (RBAC) | whole app, one role per user | user create/update (/rest-api/users), roles (/rest-api/roles) | who may create groups, send messages, start calls, ... |
| Scope (SBAC) | inside one group | group membership (/rest-api/group-members/change-scope) | admin / moderator / participant within that group |
POST https://{APP_ID}.api-{REGION}.cometchat.io/v3/roles; see the docs at {DOCS_BASE}/rest-api/roles) — each user gets exactly one; unspecified → default.{DOCS_BASE}/rest-api/rbac-overview). (The older per-role restrict-features API is deprecated — use RBAC.)admin/moderator/participant) are the SBAC layer; change with the change-scope API.
Model least privilege: a locked-down default role, elevated roles for staff/moderators, plus group scopes for in-group moderation.cometchat-compliance; self-hosting for full sovereignty is cometchat-self-host.cometchat-<family>-production).default; define roles + permissions explicitly.restrict-features instead of RBAC.IdP login → server mints a token from the session UID → the client's per-family auth-token login succeeds (loginWithAuthToken / iOS login(authToken:) / RN login({ authToken })) · a tampered/?uid= request is rejected · flushing a user's tokens ends their sessions on every device · a default-role user is denied a restricted action (ERR_PERMISSION_DENIED) while an elevated role is allowed · no Auth Key or REST API Key anywhere in client code.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
cometchat, sso, rbac, auth-tokens, session-revocation, multi-tenant
npx claudepluginhub cometchat/cometchat-skills --plugin cometchat-skills98 skills in this plugin
/cometchatEntry point for any CometChat task on any platform. Detects the framework + UI Kit version (React, Angular, iOS, Android, React Native, Flutter), then routes to that family's skills — for a NEW integration or a change to an existing one. Triggers: 'add chat', 'add cometchat', 'add chat to my app', 'add calling', 'change something in my chat', 'my chat is already set up', 'add a feature to the chat', 'add chat to my android app', 'integrate cometchat android', 'add chat to my ios app', 'integrate cometchat ios', 'add chat to my swift app', 'migrate my app to cometchat', 'migrate from sendbird', 'migrate from getstream / stream', 'replace sendbird / stream chat with cometchat', 'build a <app> clone', 'make a chat app like <app>', 'make it look and work like <app>'./cometchat-a11yKeep a CometChat integration accessible — the UI Kit is designed targeting WCAG 2.1 AA with keyboard navigation (verify per component in its docs; full conformance still needs manual testing), and this skill makes sure the HOST app doesn't break that, covering contrast, focus, screen-reader context, reduced motion, RTL, and calls accessibility. Cross-family. Triggers: 'is cometchat accessible', 'WCAG / 508 / ADA compliance', 'screen reader support', 'keyboard navigation', 'a11y audit', 'accessible chat', 'contrast/focus issues in chat'.Other plugins' skills for the same job