Repository navigation
Conversation
Signed-off-by: Jorge Turrado <jorge_turrado@hotmail.es>
JorTurFer
force-pushed
the
support-wif
branch
from
October 17, 2026 00:33
df44ec6 to
804fbab
Compare
Signed-off-by: Jorge Turrado <jorge_turrado@hotmail.es>
JorTurFer
marked this pull request as ready for review
October 17, 2026 01:12
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Fixes #1668
Changes
Read
STACKIT_SERVICE_CONNECTION_IDon Azure PipelinesWhen running in Azure DevOps with the STACKIT Service Connection, the CLI now passes
STACKIT_SERVICE_CONNECTION_IDtooidcadapters.RequestAzureDevOpsOIDCToken, the same way the Terraform provider does. Without this, the CLI and Terraform get OIDC tokens with a differentsubwhen they run in the same pipeline, so the same federated identity provider assertions can't serve both.Store the session on
stackit auth activate-service-account --use-oidcUntil now,
activate-service-account --use-oidcprintedAuthenticated via Workload Identity Federation.but never stored anything, so the next command (e.g.stackit project list) failed withyou are not authenticated. With a service account key,activate-service-accountstores the session and the following commands use it; this PR does the same for WIF:sa_wif(AUTH_FLOW_WORKLOAD_IDENTITY).activate-service-account --use-oidcstores it together with the service account email and the custom token endpoint, unless--only-print-access-tokenis set.OIDCTokenFunc), and the SDK requests a new access token when needed. The token source must still be available, e.g. in the same CI job.AuthenticationConfig,GetValidAccessTokenandGetProfileEmailsupport the new flow. As a result,project list/create,organization list,curl,auth get-access-tokenandske kubeconfig loginwork after activating, and the session time limit applies like for the other service account flows.AuthenticateServiceAccountset the flow type tosa_key(unused before because nothing was written). It now usessa_wifand clearsSERVICE_ACCOUNT_KEY/PRIVATE_KEY, so leftovers from a previous key activation don't stay in the storage.AUTHENTICATION.mddocumentsactivate-service-account --use-oidcas the way to use WIF, andSTACKIT_SERVICE_CONNECTION_ID.Note:
STACKIT_USE_OIDC=1withoutactivate-service-accountThis PR doesn't change that mode: the env-based path in
AuthenticationConfigis untouched. While testing, we noticed it only works for commands that just call an API. Commands that read the stored session fail when nothing was activated:project list(without--parent-id/--member),project createget email of authenticated user: error getting profile email. email is emptyorganization listmemberauth get-access-token,curl,ske kubeconfig loginUserSessionExpired()fails parsing the emptySESSION_EXPIRES_AT_UNIXWith this PR,
activate-service-account --use-oidcfollowed by any command works, consistent with the key flow. We'd suggest treatingactivate-service-accountas the supported path and discussing in a follow-up issue whether the env-only mode should be fixed or deprecated.Checklist
make fmtmake generate-docs(will be checked by CI)make test(will be checked by CI)make lint(will be checked by CI)🤖 Generated with Claude Code