OAuth integration for Box. Provider id is box.
import { box } from "@lucia-auth/oauth/providers";
import { auth } from "./lucia.js";
const boxAuth = box(auth, configs);
box()#
const box: (
	auth: Auth,
	configs: {
		clientId: string;
		clientSecret: string;
		redirectUri: string;
	}
) => BoxProvider;
Parameters#
| name | type | description | 
|---|
auth | Auth | Lucia instance | 
config.clientId | string | Box OAuth app client id | 
config.clientSecret | string | Box OAuth app client secret | 
config.redirectUri | string | an authorized redirect URI | 
 
Returns#
Interfaces#
BoxAuth#
See OAuth2ProviderAuth.
// implements OAuth2ProviderAuth<BoxAuth<_Auth>>
interface BoxAuth<_Auth extends Auth> {
	getAuthorizationUrl: () => Promise<readonly [url: URL, state: string]>;
	validateCallback: (code: string) => Promise<BoxUserAuth<_Auth>>;
}
Generics#
| name | extends | default | 
|---|
_Auth | Auth | Auth | 
 
BoxTokens#
type BoxTokens = {
	accessToken: string;
};
BoxUser#
type BoxUser = {
	id: string;
	type: "user";
	address: string;
	avatar_url: string;
	can_see_managed_users: boolean;
	created_at: string;
	enterprise: {
		id: string;
		type: string;
		name: string;
	};
	external_app_user_id: string;
	hostname: string;
	is_exempt_from_device_limits: boolean;
	is_exempt_from_login_verification: boolean;
	is_external_collab_restricted: boolean;
	is_platform_access_only: boolean;
	is_sync_enabled: boolean;
	job_title: string;
	language: string;
	login: string;
	max_upload_size: number;
	modified_at: string;
	my_tags: [string];
	name: string;
	notification_email: {
		email: string;
		is_confirmed: boolean;
	};
	phone: string;
	role: string;
	space_amount: number;
	space_used: number;
	status:
		| "active"
		| "inactive"
		| "cannot_delete_edit"
		| "cannot_delete_edit_upload";
	timezone: string;
	tracking_codes: {
		type: string;
		name: string;
		value: string;
	}[];
};
BoxUserAuth#
Extends ProviderUserAuth.
interface BoxUserAuth<_Auth extends Auth> extends ProviderUserAuth<_Auth> {
	boxUser: BoxUser;
	boxTokens: BoxTokens;
}
| properties | type | description | 
|---|
boxUser | BoxUser | Box user | 
boxTokens | BoxTokens | Access tokens etc | 
 
Generics#