Skip to main content

Get credentials

1

Create an OAuth consumer

Go to your Bitbucket workspace settings: Workspace Settings > Apps and features > OAuth consumers > Add consumer.Set the Callback URL to:
Under Permissions, enable at minimum Account: Read.
2

Copy your credentials

After saving, expand the consumer to see the Key (client ID) and Secret (client secret).

Configuration

lib/theauth.ts

Scopes

Default scopes: account, email
Bitbucket does not expose the user’s email by default through the profile endpoint if it is set to private. The email scope fetches it from a separate endpoint. theAuth requests both automatically.
This is a preset built on the generic OIDC factory, which reads the user from https://api.bitbucket.org/2.0/user and requires the response to contain the OIDC sub and email fields. That endpoint returns uuid and account_id fields and no email, so sign-in is expected to fail with Bitbucket userinfo response missing required "sub" field. This preset has not been verified against the live service.

Endpoints

Last modified on October 7, 2026