Grant several organizations in one OAuth consent
- Category
- Product
- Published
Users can give an OAuth client or an MCP client access to up to 5 organizations in a single consent.
When an OAuth client requests the user:org:read scope, the consent screen now lets the user select up to 5 organizations instead of one. One consent covers all of them, so a client that reads the new granted_orgs claim no longer needs one connection per organization.
This is on for every Clerk application.
What's new
- Multiple selection on the consent screen: the Account Portal consent page and the
<OAuthConsent />component (@clerk/ui1.46.0 or later) show the new selector. It preselects the user's active organization, or the first one in the list when the user has no active organization in it. - A
granted_orgsclaim: when the user selects two or more organizations, JWT access tokens and the token introspection response list them as{ id, name }objects, with the default organization first. The default is the user's active organization when they selected it, otherwise the first selected one in list order.org_idstill holds the default organization, so a client that reads onlyorg_idkeeps working. orgIdandgrantedOrgsin the SDKs: with@clerk/backend3.35.0 or later (for example,@clerk/nextjs7.10.12),auth({ acceptsToken: 'oauth_token' })returns both values for a verified OAuth token.grantedOrgsisnullwhen the user granted fewer than two.- The same fields from the Backend API: for both JWT and opaque access tokens, the token verification request returns
org_id, plusgranted_orgswhen the user granted two or more organizations. - Custom consent pages: submit one
organization_idfield with the selected IDs separated by a space, default first.
A JWT access token for two organizations includes these claims:
{
"org_id": "org_123",
"granted_orgs": [
{ "id": "org_123", "name": "Acme" },
{ "id": "org_456", "name": "Globex" }
]
}The Clerk MCP server supports several organizations in one consent too: one connection can cover up to 5 workspaces, and each account tool except submit_feedback accepts an optional workspace input. To change the workspaces a connection covers, sign out of the Clerk MCP server in your AI client and connect again.
Good to know
- The selection records what the user chose at consent. It isn't a membership check, and it carries no role. If your server authorizes by organization, first check that the token grants the organization (it's in
granted_orgs, or it matchesorg_id), then check the user's current membership and role before you act. - A token refresh keeps the same organizations. A new consent issues tokens for the new selection, but it doesn't revoke the tokens from an earlier consent.
- ID tokens and the user info endpoint describe only the default organization. They don't include
granted_orgs. - The Device Authorization Grant still selects one organization.
To learn more, see Organizations and OAuth, Verify OAuth tokens, and Set up a custom OAuth consent page.