Skip to content
Migrating from NextAuth.js v4? Read our migration guide.

providers/bitbucket

Built-in Bitbucket integration.

BitbucketProfile

See

https://developer.atlassian.com/cloud/bitbucket/rest/api-group-users/#api-user-get

Properties

account_id

account_id: string;

account_status

account_status: string;

created_on

created_on: string;

display_name

display_name: string;

has_2fa_enabled

has_2fa_enabled: null | boolean;

is_staff

is_staff: boolean;
links: Record<LiteralUnion<
  | "html"
  | "self"
  | "avatar"
  | "repositories"
  | "snippets"
  | "hooks", string>, {
  href: string;
}>;

location

location: null | string;

nickname

nickname: string;

type

type: string;

username

username: string;

uuid

uuid: string;

default()

default(config): OAuthConfig<BitbucketProfile>

Setup

Callback URL

https://example.com/api/auth/callback/bitbucket

Configuration

import { Auth } from "@auth/core"
import Bitbucket from "@auth/core/providers/bitbucket"
 
const request = new Request(origin)
const response = await Auth(request, {
  providers: [
    Bitbucket({
      clientId: process.env.BITBUCKET_CLIENT_ID,
      clientSecret: process.env.BITBUCKET_CLIENT_SECRET,
    })
  ],
})

Notes

By default, Auth.js assumes that the Bitbucket provider is based on the OAuth 2 specification.

Registration

Resources

💡

The Bitbucket provider comes with a default configuration. To override the defaults for your use case, check out customizing a built-in OAuth provider.

Disclaimer If you think you found a bug in the default configuration, you can open an issue.

Auth.js strictly adheres to the specification and it cannot take responsibility for any deviation from the spec by the provider. You can open an issue, but if the problem is non-compliance with the spec, we might not pursue a resolution. You can ask for more help in Discussions.

Parameters

ParameterType
configOAuthUserConfig<BitbucketProfile>

Returns

OAuthConfig<BitbucketProfile>

Auth.js © Balázs Orbán and Team - 2024