Sync OIDC provider groups to BamBuddy groups on every login (issue #3107) (#3122)

This commit is contained in:
William Faircloth
2026-09-29 15:49:44 +02:00
committed by GitHub
parent 2af6f644d1
commit d04514c842
30 changed files with 2059 additions and 13 deletions
+17 -1
View File
@@ -4409,6 +4409,16 @@ export interface TwoFAVerifyRequest {
export type SameOriginUrl = string & { readonly __brand: 'SameOriginUrl' };
// OIDC interfaces
/** What the unauthenticated GET /auth/oidc/providers returns (#3107): only
* what the login page renders. The full provider, group sync config
* included, needs the admin-only /auth/oidc/providers/all. */
export interface OIDCProviderPublic {
id: number;
name: string;
has_icon: boolean;
is_autologin: boolean;
}
export interface OIDCProvider {
id: number;
name: string;
@@ -4420,6 +4430,9 @@ export interface OIDCProvider {
auto_link_existing_accounts: boolean;
email_claim: string;
require_email_verified: boolean;
// #3107 — group sync. Empty mapping = sync off (default).
group_claim?: string;
group_mapping?: Record<string, string>;
icon_url?: string | null;
default_group_id?: number | null;
// True when the backend has cached icon bytes for this provider.
@@ -4451,6 +4464,9 @@ export interface OIDCProviderCreate {
auto_link_existing_accounts?: boolean;
email_claim?: string;
require_email_verified?: boolean;
// #3107 — group sync. Omit both to leave them unchanged on update.
group_claim?: string;
group_mapping?: Record<string, string>;
icon_url?: string | null;
default_group_id?: number | null;
is_autologin?: boolean; // #1589
@@ -4660,7 +4676,7 @@ export const api = {
request<{ message: string }>(`/auth/2fa/admin/${userId}`, { method: 'DELETE' }),
// OIDC providers (public list)
getOIDCProviders: () => request<OIDCProvider[]>('/auth/oidc/providers'),
getOIDCProviders: () => request<OIDCProviderPublic[]>('/auth/oidc/providers'),
// OIDC providers (admin)
getOIDCProvidersAll: () => request<OIDCProvider[]>('/auth/oidc/providers/all'),