Skip to content

Organization Login

Organization login lets a user sign in to one of their organizations rather than to your app as a whole. The hosted login page shows the organization’s name and logo and only its connections, AuthAction checks that the user is a member, and the tokens say which organization the session is for.

In the dashboard, open the application and find Authentication policy > Organizations:

SettingWhat happens
OffThe default. An organization parameter on the authorize request is refused.
OptionalThe authorize request may name an organization. Without one, the user signs in for themselves and the tokens carry no organization.
RequiredEvery login ends in an organization. A member of one goes straight in; a member of several chooses on a picker; a member of none is turned away.

With the Management API, set organizationUsage to none, optional or required on PATCH /api/v1/applications/{id}.

Add organization to the authorize request, with the organization’s name or id:

const { loginWithRedirect } = useAuthAction();
loginWithRedirect({ authorizationParams: { organization: "acme" } });

The login page then shows the organization’s display name and logo. If the organization has exactly one social or enterprise connection, the login page is skipped and the user goes straight to that identity provider.

An unknown organization, or one sent for an application with organizations turned off, shows an error page.

Only members get a code. A user who signs in but isn’t a member is sent back to your redirect URI with:

?error=access_denied&error_description=The user is not a member of the organization&state=...

Add members on the organization’s Members tab or with POST /api/v1/organizations/{id}/members.

On the organization’s Login tab, Join automatically makes a user a member when they sign in to the organization:

  • through one of the organization’s connections, or
  • with a verified email address at one of its domains.

An unverified address never qualifies.

The organization’s Login tab also sets:

  • Connections: the ways members sign in to this organization, usually its SAML or Google Workspace connection. Only connections also enabled for the application are offered. Leave it empty to use the application’s connections.
  • Email domains: on the login page, an address at one of these domains goes straight to the organization’s connection, so alice@acme.com signs in with Acme’s identity provider without choosing it. This needs the application’s Organizations setting to be Optional or Required. A domain can belong to one organization.
  • Logo URL: shown on the login page in place of the tenant’s logo.

With the Management API:

PATCH /api/v1/organizations/{id}
Content-Type: application/json
{
"domains": ["acme.com"],
"connections": ["<connection id>"],
"autoMembership": true,
"logoUrl": "https://cdn.acme.com/logo.svg"
}

When the application requires an organization and the request doesn’t name one, a user who belongs to several chooses on a picker after signing in. The picker lists only their own organizations.

A login for an organization adds these claims:

ClaimAccess tokenID tokenValue
org_idYesYesThe organization’s id
org_nameYesYesThe organization’s name, such as acme
org_rolesYesNoThe user’s role names in the organization

Check org_id on your API before acting on an organization’s data. Token introspection returns the same claims.

Refreshing re-reads them: roles changed since sign-in show up in the new access token, and a user removed from the organization, or an organization deleted, can no longer refresh.

An existing session is reused for another login to the same organization. A login to an organization the user doesn’t belong to returns access_denied rather than asking them to sign in again.

GET /billing/entitlements with an access token issued for an organization returns that organization’s plan, without ?organization=. See Entitlements.