@@ -105,13 +105,20 @@ To authenticate with the SDK, you need a [service account](https://docs.stackit.
105105
106106The SDK supports two authentication methods:
107107
108- 1 . ** Key Flow** (Recommended)
108+ 1 . ** Workload Identity Federation Flow** (Recommended)
109+
110+ - Uses OIDC trusted tokens
111+ - Provides best security through short-lived tokens without secrets
112+
113+ > NOTE: This flow isn't publicly available yet. It'll be public during Q1 2026
114+
115+ 2 . ** Key Flow** (Recommended)
109116
110117 - Uses RSA key-pair based authentication
111118 - Provides better security through short-lived tokens
112119 - Supports both STACKIT-generated and custom key pairs
113120
114- 2 . ** Token Flow**
121+ 3 . ** Token Flow**
115122 - Uses long-lived service account tokens
116123 - Simpler but less secure
117124
@@ -120,10 +127,42 @@ The SDK supports two authentication methods:
120127The SDK searches for credentials in the following order:
121128
1221291 . Explicit configuration in code
123- 2 . Environment variables (KEY_PATH for KEY)
130+ 2 . Environment variables
1241313 . Credentials file (` $HOME/.stackit/credentials.json ` )
125132
126- For each authentication method, the key flow is attempted first, followed by the token flow.
133+ For each authentication method, the try order is:
134+ 1 . Workload Identity Federation Flow
135+ 2 . Key Flow
136+ 3 . Token Flow
137+
138+ ### Using the Workload Identity Fedearion Flow
139+
140+ 1 . Create a service account trusted relation in the STACKIT Portal:
141+
142+ - Navigate to ` Service Accounts ` → Select account → ` Federated Identity Providers ` → Add a Federated Identity Provider
143+ - Configure the trusted issuer and the required assertions to trust in. (Link to official docs here after GA)
144+
145+ 2 . Configure authentication using any of these methods:
146+
147+ ** A. Code Configuration**
148+
149+ ``` go
150+ // Using wokload identity federation flow
151+ config.WithWorkloadIdentityFederationAuth ()
152+ // With the custom path for the external OIDC token
153+ config.WithWorkloadIdentityFederationTokenPath (" /path/to/your/federated/token" )
154+ // For the service account
155+ config.
WithServiceAccountEmail (
" [email protected] " )
156+ ```
157+
158+ ** B. Environment Variables**
159+
160+ ``` bash
161+ # With the custom path for the external OIDC token
162+ STACKIT_FEDERATED_TOKEN_FILE=/path/to/your/federated/token
163+ # For the service account
164+ 165+ ```
127166
128167### Using the Key Flow
129168
0 commit comments