This authentication method works for human users but not for service accounts, since only humans may have CockroachDB Cloud Console identities. To authenticate service accounts using JWT tokens from an external IdP, refer to .Note that the topic of this page is SQL access to a specific CockroachDB Cluster, not access to a CockroachDB Cloud organization. For the latter, see .
Before you begin
For more details and examples, refer to SSO to CockroachDB clusters using JWT in the CockroachDB blog.- You must be a member of a CockroachDB Cloud organization, and you must have access to an existing cluster or the permission to create a new cluster. For help setting up an organization and cluster, refer to .
- To authenticate to a specific cluster using SSO, a CockroachDB Cloud user must have a corresponding SQL user already on that cluster. CockroachDB Cloud generates a SSO SQL username for each console, corresponding to the user’s email by the convention
sso_{email_name}, whereemail_nameis everything up to the@in an email address, for example the SQL usersso_docswould result fromdocs@cockroachlabs.com.ccloudwill prompt you to make this user if it does not already exist, in which case an admin must create it manually. - must be installed on your local system.
Sign in with Cluster SSO
-
Authenticate
ccloudto your CockroachDB Cloud organization. When you run the following command, your workstation’s default browser opens the CockroachDB Cloud login page for your organization. -
You may then use the
ccloudutility to authenticate to your CockroachDB Cloud cluster, allowing you to access the SQL interface. Your browser will open again asccloudrequests an access token, although will not need to log in again if you are already logged in.
Troubleshooting
If you get an error that the SQL user is missing, you may need to create it manually. The SQL user’s username must match the CockroachDB Cloud identity’s email address, according to the following convention: email:{name}@emaildomain.com SQL username: sso_{name}
For example, a user named docs_rule@cockroachlabs.com would need a SQL username of sso_docs_rule
You can with:
What’s Next?
- Read about SSO to CockroachDB clusters using JWT in the CockroachDB blog.
- Learn more about .

