The BitbucketSSO class facilitates Single Sign-On (SSO) via Bitbucket. This integration enables your application to authenticate users with their Bitbucket accounts, providing an easy way for users to log in without creating a new account on your platform.
To set up Bitbucket SSO, you need to obtain and set the following environment variables:
BITBUCKET_CLIENT_ID: Bitbucket OAuth client IDBITBUCKET_CLIENT_SECRET: Bitbucket OAuth client secret
- Visit the Bitbucket developer portal: Bitbucket OAuth Settings.
- Log in with your Bitbucket account.
- Navigate to "OAuth" under "Access Management."
- Click on "Add consumer."
- Fill in the required details:
- Name: A name for your application.
- Description: A brief description of what the application does.
- Callback URL: The URL to which Bitbucket will send users after they authorize.
- Select the necessary scopes for your application. For Bitbucket SSO, you need at least:
accountemail
- Save the consumer to get the Client ID and Client Secret.
Add the obtained credentials to your .env file:
BITBUCKET_CLIENT_ID=your_bitbucket_client_id
BITBUCKET_CLIENT_SECRET=your_bitbucket_client_secretEnsure that you request the following scopes when redirecting users for authentication:
accountemail