Bitbucket OAuth provider
OAuth integration for Bitbucket. Provider id is bitbucket
.
Make sure you enable scope account
in your Bitbucket app settings.
import { bitbucket } from "@lucia-auth/oauth/providers";
import { auth } from "./lucia.js";
const bitbucketAuth = bitbucket(auth, configs);
bitbucket()
#
Scopes can only be configured from your Bitbucket app settings.
const bitbucket: (
auth: Auth,
configs: {
clientId: string;
clientSecret: string;
redirectUri: string;
}
) => BitbucketProvider;
Parameters#
name | type | description |
---|---|---|
auth | Auth | Lucia instance |
config.clientId | string | Bitbucket OAuth app client id |
config.clientSecret | string | Bitbucket OAuth app client secret |
config.redirectUri | string | an authorized redirect URI |
Returns#
type | description |
---|---|
BitbucketProvider | Bitbucket provider |
Interfaces#
BitbucketAuth
#
See OAuth2ProviderAuth
.
// implements OAuth2ProviderAuth<BitbucketAuth<_Auth>>
interface BitbucketAuth<_Auth extends Auth> {
getAuthorizationUrl: () => Promise<readonly [url: URL, state: string]>;
validateCallback: (code: string) => Promise<BitbucketUserAuth<_Auth>>;
}
Generics#
name | extends | default |
---|---|---|
_Auth | Auth | Auth |
BitbucketTokens
#
type BitbucketTokens = {
accessToken: string;
accessTokenExpiresIn: number;
refreshToken: string;
};
BitbucketUser
#
type BitbucketUser = {
type: string;
links: {
avatar:
| {}
| {
href: string;
name: string;
};
};
created_on: string;
display_name: string;
username: string;
uuid: string;
};
BitbucketUserAuth
#
Extends ProviderUserAuth
.
interface BitbucketUserAuth<_Auth extends Auth>
extends ProviderUserAuth<_Auth> {
bitbucketUser: BitbucketUser;
bitbucketTokens: BitbucketTokens;
}
properties | type | description |
---|---|---|
bitbucketUser | BitbucketUser | Bitbucket user |
bitbucketTokens | BitbucketTokens | Access tokens etc |
Generics#
name | extends |
---|---|
_Auth | Auth |