Clerk logo

Clerk Docs

Ctrl + K
Go to
Check out a preview of our new docs.


How to set up social connection with Bitbucket


Adding social connection with Bitbucket to your app with Clerk is straightforward - you will need to populate the Client ID, Client Secret and Authorized redirect URI in your instance settings.

To make the development flow as smooth as possible, Clerk uses preconfigured shared OAuth credentials and redirect URIs for development instances - no other configuration is needed.

For production instances, you will need to generate your own Consumer Key and Consumer Secret using your Bitbucket account.

The purpose of this guide is to help you create a Bitbucket account and a Bitbucket OAuth Consumer - if you're looking for step-by-step instructions using Clerk to add social connection (OAuth) to your application, follow the Social connection (OAuth) guide.

Before you start

Configuring Bitbucket social connection

Firstly, you will need to have a Bitbucket workspace.

You can navigate to the list of all your workspaces to select an existing workspace or create a new one:

Bitbucket workspace listing

From there, click on the desired existing workspace or create a new one, then navigate to:

Settings > Oauth Consumers

Bitbucket OAuth Consumer list

You will need to create a consumer if you don't have one already.

The first important setting for the connection to work is the Callback URL. In this field the Authorized redirect URI from your Clerk Bitbucket settings should be pasted:

OAuth consumer creation

The rest of the form fields (Name, Description, URL, Privacy Policy URL, EULA URL) can be set to match your application settings.

The second important setting is the selection of scopes that Clerk should request from Bitbucket upon connecting.

Bitbucket OAuth Consumer scopes

Under Account, the Email & Read scopes should be enabled so that Clerk can use your basic Bitbucket account info when creating your Clerk user.

After saving the Oauth Consumer, Bitbucket will generate a Consumer Key & Consumer Secret for you. These can be displayed by clicking on the Consumer entry in your Oauth Consumer list.

You will need to copy:

  • The Bitbucket Client Key to the Client ID input on ClerkThe Bitbucket
  • Client Secret to the Client Secret input on Clerk

Client ID and Client Secret inputs for Bitbucket connection

That's it, now you are all set to sign up & sign in to Clerk with Bitbucket!

Was this helpful?

Clerk © 2023