[Feature] Add support for OIDC in admin API #1184

Open
opened 2025-12-29 02:28:45 +01:00 by adam · 0 comments
Owner

Originally created by @red-lichtie on GitHub (Dec 22, 2025).

Use case

When OIDC is configured, there should be a way check tokens for administrative rights which can then be used to grant API access.

Description

When an OIDC provider is configured, token issued by the provider should be able to grant access to the administration API.

There could be tests against claims like

oidc:
  admin_domains:
    - "mydomain.tld"
  admin_users:
    - "admin@mydomain.tld"
  admin_groups:
    - "headscale_admins"

This could be checked before the current database driven API system.

Contribution

  • I can write the design doc for this feature
  • I can contribute this feature

How can it be implemented?

Extend OIDC support for additional administrative claims configuration ().

Checking if provided OIDC token grants admin access, if not then continue classical API token validation.

Originally created by @red-lichtie on GitHub (Dec 22, 2025). ### Use case When OIDC is configured, there should be a way check tokens for administrative rights which can then be used to grant API access. ### Description When an OIDC provider is configured, token issued by the provider should be able to grant access to the administration API. There could be tests against claims like ```yaml oidc: admin_domains: - "mydomain.tld" admin_users: - "admin@mydomain.tld" admin_groups: - "headscale_admins" ``` This could be checked before the current database driven API system. ### Contribution - [ ] I can write the design doc for this feature - [ ] I can contribute this feature ### How can it be implemented? Extend OIDC support for additional administrative claims configuration (). - Some kind of `CheckOIDCAdminAccessGranted` method in https://github.com/juanfont/headscale/blob/main/hscontrol/oidc.go Checking if provided OIDC token grants admin access, if not then continue classical API token validation. - Call `CheckOIDCAdminAccessGranted` here? https://github.com/juanfont/headscale/blob/7be20912f5861ef9d6fa42a615e44e6c0b0f2c17/hscontrol/app.go#L363
adam added the enhancement label 2025-12-29 02:28:45 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/headscale#1184