Skip to content

feat(auth): add Workload Identity Federation (OIDC) support - #1424

Merged
GokceGK merged 7 commits into
stackitcloud:mainfrom
philross:feat/wif-auth-support
Jul 21, 2026
Merged

feat(auth): add Workload Identity Federation (OIDC) support#1424
GokceGK merged 7 commits into
stackitcloud:mainfrom
philross:feat/wif-auth-support

Conversation

@philross

@philrossphilross commented Jun 1, 2026

Copy link
Copy Markdown
Contributor

Description

Adds Workload Identity Federation (OIDC) support so CI/CD pipelines can authenticate without long-lived service account key files. The CLI exchanges a short-lived OIDC token for a STACKIT access token using the go SDK's WIF flow.

  • New internal/pkg/auth/auth.go with env-var helpers (STACKIT_USE_OIDC, STACKIT_SERVICE_ACCOUNT_EMAIL, STACKIT_SERVICE_ACCOUNT_FEDERATED_TOKEN)
  • Auto-detects token source: env var → GitHub Actions → Azure Pipelines
  • No credentials are written to disk in WIF mode
  • Updated AUTHENTICATION.md with setup guide

relates to #1327

Checklist

  • Issue was linked above
  • Code format was applied: make fmt
  • Examples were added / adjusted (see e.g. here)
  • Docs are up-to-date: make generate-docs (will be checked by CI)
  • Unit tests got implemented or updated
  • Unit tests are passing: make test (will be checked by CI)
  • No linter issues: make lint (will be checked by CI)

@philross

Copy link
Copy Markdown
ContributorAuthor

Before I continue working on this feature: Is the introduction of environment variables (STACKIT_USE_OIDC, STACKIT_SERVICE_ACCOUNT_EMAIL, STACKIT_SERVICE_ACCOUNT_FEDERATED_TOKEN) mentioned in #1327 the right approach, or should CLI flags (e.g. --use-oidc) be added instead?

@github-actions

Copy link
Copy Markdown

This PR was marked as stale after 7 days of inactivity and will be closed after another 7 days of further inactivity. If this PR should be kept open, just add a comment, remove the stale label or push new commits to it.

@philross

Copy link
Copy Markdown
ContributorAuthor

Not stale, @GokceGK could you help route this to the right person/team to get an initial response on the question above?

@GokceGK

Copy link
Copy Markdown
Contributor

Hi @philross,

thanks for starting this contribution. I will check your question and get back to you asap.

Regards,
Gökce from the STACKIT Developer Tools Team

@GokceGK

Copy link
Copy Markdown
Contributor

Hi @philross,

you can use env variables, but please align them with the STACKIT Terraform Provider.

Regards,
Gökce from the STACKIT Developer Tools Team

@philross

Copy link
Copy Markdown
ContributorAuthor

Thanks @GokceGK,

According to https://registry.terraform.io/providers/stackitcloud/stackit/latest/docs/guides/workload_identity_federation, STACKIT_USE_OIDC and STACKIT_SERVICE_ACCOUNT_EMAIL are already compliant with the STACKIT Terraform Provider convention. In the case of STACKIT_SERVICE_ACCOUNT_FEDERATED_TOKEN, the docs just mention using service_account_federated_token in the provider configuration. But since the naming is consistent I think keeping STACKIT_SERVICE_ACCOUNT_FEDERATED_TOKEN should be fine.

@philross
philrossforce-pushed the feat/wif-auth-support branch from f0d60b0 to 415910fCompareJune 12, 2026 05:32
@philross
philross marked this pull request as ready for review June 12, 2026 05:47
@philross
philross requested a review from a team as a code ownerJune 12, 2026 05:47
@github-actions

Copy link
Copy Markdown

This PR was marked as stale after 7 days of inactivity and will be closed after another 7 days of further inactivity. If this PR should be kept open, just add a comment, remove the stale label or push new commits to it.

@philross

Copy link
Copy Markdown
ContributorAuthor

Not stale

@github-actions

Copy link
Copy Markdown

This PR was marked as stale after 7 days of inactivity and will be closed after another 7 days of further inactivity. If this PR should be kept open, just add a comment, remove the stale label or push new commits to it.

Comment threadinternal/cmd/auth/activate-service-account/activate_service_account_test.go Outdated
Comment threadinternal/pkg/auth/oidc.go Outdated
Comment threadinternal/cmd/auth/activate-service-account/activate_service_account_test.go Outdated
Comment threadinternal/pkg/auth/oidc_test.go Outdated
@GokceGK
GokceGK enabled auto-merge (squash) July 21, 2026 12:19
@Fyusel
Fyuselforce-pushed the feat/wif-auth-support branch from 45123d9 to 4e34aabCompareJuly 21, 2026 12:49
@GokceGK
GokceGK merged commit bc0a6f2 into stackitcloud:mainJul 21, 2026
3 checks passed
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@philross@GokceGK@Fyusel@cgoetz-inovex