How to set up social login with Bitbucket
Adding social login 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 login (OAuth) to your application, follow the Social login (OAuth) guide.
Before you start
- You need to create a Clerk Application in your Clerk Dashboard. For more information, check out our Set up your application guide.
- You need to have a Bitbucket account. To create one, click here.
Configuring Bitbucket social login
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:
From there, click on the desired existing workspace or create a new one, then navigate to:
Settings > Oauth Consumers
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:
The second important setting is the selection of scopes that Clerk should request from Bitbucket upon connecting.
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
That's it, now you are all set to sign up & sign in to Clerk with Bitbucket!