Atlassian OAuth provider
OAuth 2.0 (Authorization code) integration for Atlassian. Provider id is atlassian
.
import { atlassian } from "@lucia-auth/oauth/providers";
import { auth } from "./lucia.js";
const atlassianAuth = atlassian(auth, configs);
atlassian()
#
Scopes read:me
is always included.
const atlassian: (
auth: Auth,
configs: {
clientId: string;
clientSecret: string;
redirectUri: string;
scope?: string[];
}
) => AtlassianProvider;
Parameters#
name | type | description | optional |
---|---|---|---|
auth | Auth | Lucia instance | |
config.clientId | string | Atlassian OAuth app client id | |
config.clientSecret | string | Atlassian OAuth app client secret | |
config.redirectUri | string | an authorized redirect URI | |
config.scope | string[] | an array of scopes | ✓ |
Returns#
type | description |
---|---|
AtlassianProvider | Atlassian provider |
Interfaces#
AtlassianAuth
#
See OAuth2ProviderAuth
.
// implements OAuth2ProviderAuth<AtlassianAuth<_Auth>>
interface AtlassianAuth<_Auth extends Auth> {
getAuthorizationUrl: () => Promise<readonly [url: URL, state: string]>;
validateCallback: (code: string) => Promise<AtlassianUserAuth<_Auth>>;
}
Generics#
name | extends | default |
---|---|---|
_Auth | Auth | Auth |
AtlassianTokens
#
Add scope offline_access
to get refresh tokens.
type AtlassianTokens = {
accessToken: string;
accessTokenExpiresIn: number;
refreshToken: string | null;
};
AtlassianUser
#
type AtlassianUser = {
account_type: string;
account_id: string;
email: string;
name: string;
picture: string;
account_status: string;
nickname: string;
zoneinfo: string;
locale: string;
extended_profile?: Record<string, string>;
};
AtlassianUserAuth
#
Extends ProviderUserAuth
.
interface AtlassianUserAuth<_Auth extends Auth>
extends ProviderUserAuth<_Auth> {
atlassianUser: AtlassianUser;
atlassianTokens: AtlassianTokens;
}
properties | type | description |
---|---|---|
atlassianUser | AtlassianUser | Atlassian user |
atlassianTokens | AtlassianTokens | Access tokens etc |
Generics#
name | extends |
---|---|
_Auth | Auth |