OpenID Connect: scopes, custom parameters and domain filter #258

Closed
opened 2025-12-29 01:25:09 +01:00 by adam · 3 comments
Owner

Originally created by @apognu on GitHub (Apr 25, 2022).

I had a quick look at the config and code for the OpenID Connect integration, and right now, as far as I can tell, the scopes are hardcoded. It should be possible to customize them to fit one's deployment.

Also, some OpenID Connect implementation (namely, Google Auth) allows any Google Account to connect even if the application was created within a Google Workspace namespace. Only allowing account in specific domains would make sense here for enterprise deployments of Headscale (or even individuals with their own domain).

Lastly, we could allow custom parameters to be added to the request in the Authorize Endpoint of the flow. Some providers provide functionnality behind those custom query parameters, for instance:

  • hd on Google Auth or domain_hint on Azure AD
  • tenant on Azure AD

I could work on a PR if those features are of interest.

Originally created by @apognu on GitHub (Apr 25, 2022). I had a quick look at the config and code for the OpenID Connect integration, and right now, as far as I can tell, the _scopes_ are hardcoded. It should be possible to customize them to fit one's deployment. Also, some OpenID Connect implementation (namely, Google Auth) allows any Google Account to connect even if the application was created within a Google Workspace namespace. Only allowing account in specific domains would make sense here for enterprise deployments of Headscale (or even individuals with their own domain). Lastly, we could allow custom parameters to be added to the request in the Authorize Endpoint of the flow. Some providers provide functionnality behind those _custom_ query parameters, for instance: * `hd` on Google Auth or `domain_hint` on Azure AD * `tenant` on Azure AD I could work on a PR if those features are of interest.
adam added the enhancement label 2025-12-29 01:25:09 +01:00
adam closed this issue 2025-12-29 01:25:09 +01:00
Author
Owner

@apognu commented on GitHub (Apr 25, 2022):

FYI, I have something ready if this is wanted.

@apognu commented on GitHub (Apr 25, 2022): FYI, I have something ready if this is wanted.
Author
Owner

@apognu commented on GitHub (Apr 30, 2022):

Submitted a PR with what was described here, with user allowlisting added on top of domain allowlisting (which can be useful with Google Auth without Workspace, for instance).

@apognu commented on GitHub (Apr 30, 2022): Submitted a PR with what was described here, with user allowlisting added on top of domain allowlisting (which can be useful with Google Auth without Workspace, for instance).
Author
Owner

@apognu commented on GitHub (May 3, 2022):

This was merged in #565.

@apognu commented on GitHub (May 3, 2022): This was merged in #565.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/headscale#258