Implement OIDC Group support for Google Workspace (was GSuite) issuer/provider #686

Closed
opened 2025-12-29 02:22:03 +01:00 by adam · 7 comments
Owner

Originally created by @SLoeuillet on GitHub (Apr 9, 2024).

Why

As Google is a bad organisation, they did provide the minimal to comply with OpenID (email, username, family, name)
But it lacks something that most other providers gives : groups in which the user is registered.

That would mean that using OIDC with Google Workspace would allow everyone on the domain to have VPN access.

Google could give the group, but not as a standard claim, but by calling some Google Cloud APIs.
Either calling Admin.Directory API, with a service account which has full delegation on the doman or by calling Cloud.Identity API, which is newer, and gives back the list of groups.

Description

In case of Google Workspace is used, and allowed_groups filtering is used in the headscale configuration, dynamically add the required priorietary scope that kindly ask for groups.
Then, once OIDC response comes, get the JWT auth token and query groups by using CloudIdentity API

Originally created by @SLoeuillet on GitHub (Apr 9, 2024). ## Why As Google is a bad organisation, they did provide the minimal to comply with OpenID (email, username, family, name) But it lacks something that most other providers gives : groups in which the user is registered. That would mean that using OIDC with Google Workspace would allow everyone on the domain to have VPN access. Google could give the group, but not as a standard claim, but by calling some Google Cloud APIs. Either calling Admin.Directory API, with a service account which has full delegation on the doman or by calling Cloud.Identity API, which is newer, and gives back the list of groups. ## Description In case of Google Workspace is used, and allowed_groups filtering is used in the headscale configuration, dynamically add the required priorietary scope that kindly ask for groups. Then, once OIDC response comes, get the JWT auth token and query groups by using CloudIdentity API
adam added the enhancementstaleOIDC labels 2025-12-29 02:22:03 +01:00
adam closed this issue 2025-12-29 02:22:03 +01:00
Author
Owner

@SLoeuillet commented on GitHub (Apr 9, 2024):

This has been implemented in PR #1858

@SLoeuillet commented on GitHub (Apr 9, 2024): This has been implemented in PR #1858
Author
Owner

@SLoeuillet commented on GitHub (Apr 9, 2024):

Note that there are 2 ways to get groups : direct groups & transient groups. I did choose the direct groups.

Another thing : Google Cloud Go bindings are immature, that's why I went calling the API instead of using those

@SLoeuillet commented on GitHub (Apr 9, 2024): Note that there are 2 ways to get groups : direct groups & transient groups. I did choose the direct groups. Another thing : Google Cloud Go bindings are immature, that's why I went calling the API instead of using those
Author
Owner

@github-actions[bot] commented on GitHub (Jul 9, 2024):

This issue is stale because it has been open for 90 days with no activity.

@github-actions[bot] commented on GitHub (Jul 9, 2024): This issue is stale because it has been open for 90 days with no activity.
Author
Owner

@tomvoss commented on GitHub (Aug 1, 2024):

I can voice my desire for adding Google Workspace groups support.

@SLoeuillet , Does PR #1858 add support for Google Workspace groups where the customer is not using Google Cloud Identity?

@tomvoss commented on GitHub (Aug 1, 2024): I can voice my desire for adding Google Workspace groups support. @SLoeuillet , Does PR #1858 add support for Google Workspace groups where the customer is not using Google Cloud Identity?
Author
Owner

@SLoeuillet commented on GitHub (Aug 1, 2024):

Hello

Nope, only Cloud Identity method is implemented.

The other method, using Admin API is "old school" and requires more privilèges (svc account with full domain délégation privileges)

@SLoeuillet commented on GitHub (Aug 1, 2024): Hello Nope, only Cloud Identity method is implemented. The other method, using Admin API is "old school" and requires more privilèges (svc account with full domain délégation privileges)
Author
Owner

@github-actions[bot] commented on GitHub (Dec 26, 2024):

This issue is stale because it has been open for 90 days with no activity.

@github-actions[bot] commented on GitHub (Dec 26, 2024): This issue is stale because it has been open for 90 days with no activity.
Author
Owner

@github-actions[bot] commented on GitHub (Jan 2, 2025):

This issue was closed because it has been inactive for 14 days since being marked as stale.

@github-actions[bot] commented on GitHub (Jan 2, 2025): This issue was closed because it has been inactive for 14 days since being marked as stale.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/headscale#686