Skip to content

Fix credentials for groups settings api#5165

Merged
ViniciustCosta merged 1 commit intomasterfrom
fix/fix_creds_google_groups
Feb 13, 2026
Merged

Fix credentials for groups settings api#5165
ViniciustCosta merged 1 commit intomasterfrom
fix/fix_creds_google_groups

Conversation

@ViniciustCosta
Copy link
Collaborator

@ViniciustCosta ViniciustCosta commented Feb 13, 2026

Motivation

In order to call the groups settings API to allow adding external members to groups, the service account credentials need to contain the correct scope 'https://www.googleapis.com/auth/apps.groups.settings' to verify its admin role in the correspondent Google Workspace (oss-fuzz.com in this case).

Rationale

Calling the get default creds with this scope does not work correctly. My guess is that the GKE/GCE gets the Application Default Credentials via its metadata server, which is configured by default to issue tokens within a limited set of defined scopes (e.g., cloud-platform).

An alternative is self-impersonating the service account to generate new Credentials with the right scopes. This avoids having to deal with creating a secret containing a new key for the default service account and then generating the credentials based on this key.

Note: For this to work, the SA must have the Service Account Token Creator role. This is already set for the Compute Engine default account in all prod environments.

Tests

Tested in dev by running the oss_fuzz_cc_groups cronjob with test groups. logs: https://screenshot.googleplex.com/76a7vJjjKC4NhCe.png

Check complete investigation on: b/477964128

@ViniciustCosta ViniciustCosta merged commit 3c3409e into master Feb 13, 2026
11 checks passed
@ViniciustCosta ViniciustCosta deleted the fix/fix_creds_google_groups branch February 13, 2026 18:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments