Files
outline/server/utils/GroupSyncProvider.ts
Tom Moor 1a893b0e45 Group sync framework (#11684)
Adds group sync from external authentication providers, allowing team group memberships to be automatically managed based on provider data on sign-in in the future.
2026-03-14 23:02:20 -04:00

33 lines
989 B
TypeScript

import type { AuthenticationProviderSettings } from "@shared/types";
/**
* Represents a group reported by an external authentication provider.
*/
export interface ExternalGroupData {
/** Unique identifier for the group in the provider's system. */
id: string;
/** Display name of the group. */
name: string;
}
/**
* Interface that authentication provider plugins implement to support
* group synchronization.
*/
export interface GroupSyncProvider {
/** Whether this provider requires a configurable group claim path. */
useGroupClaim: boolean;
/**
* Fetch the groups that a user belongs to from the external provider.
*
* @param accessToken - the user's OAuth access token.
* @param settings - provider-specific settings from AuthenticationProvider.settings.
* @returns array of external groups the user is a member of.
*/
fetchUserGroups(
accessToken: string,
settings: AuthenticationProviderSettings
): Promise<ExternalGroupData[]>;
}