You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: support/azure/azure-kubernetes/security/troubleshoot-aks-control-plane-authentication-external-identity-providers.md
+44-42Lines changed: 44 additions & 42 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -20,20 +20,20 @@ This article helps you troubleshoot authentication issues when accessing the Azu
20
20
21
21
## Prerequisites
22
22
23
-
- Azure CLI version 2.61.0 or later. To find the version run `az --version`. If you need to install or upgrade, see [Install Azure CLI](/cli/azure/install-azure-cli).
24
-
- A tool to connect to the Kubernetes cluster, such as the `kubectl` tool. To install `kubectl` using the Azure CLI, run the [az aks install-cli](/cli/azure/aks#az-aks-install-cli) command.
23
+
- Azure CLI version 2.61.0 or later. To determine the version, run `az --version`. If you need to install or upgrade, see [Install Azure CLI](/cli/azure/install-azure-cli).
24
+
- A tool to connect to the Kubernetes cluster, like the `kubectl` tool. To install `kubectl` using Azure CLI, run the [az aks install-cli](/cli/azure/aks#az-aks-install-cli) command.
25
25
- The JSON Web Token (JWT) authenticator configuration file used for your AKS cluster.
26
26
- Access to [jwt.ms][jwt-ms] or a similar JWT token decoder tool for debugging tokens.
Ensure your identity provider is correctly configured and accessible:
32
+
Ensure your identity provider is correctly configured and accessible. Use the following steps.
33
33
34
34
::: zone pivot="github"
35
35
36
-
1. Verify your GitHub repository has Actions enabled.
36
+
1. Verify your GitHub repository has **Actions** enabled.
37
37
2. Confirm the OpenID Connect (OIDC) provider settings are correctly configured in your workflow.
38
38
3. Ensure the audience claim in your workflow matches the authenticator configuration.
39
39
@@ -47,9 +47,9 @@ Verify the OAuth 2.0 client ID and client secret are correct.
47
47
48
48
### Step 2: Validate the issuer URL
49
49
50
-
The issuer URL must be accessible from the AKS cluster nodes:
50
+
The issuer URL must be accessible from the AKS cluster nodes. Use the following steps.
51
51
52
-
1. Verify DNS resolution for the issuer URL:
52
+
1. Verify DNS resolution for the issuer URL.
53
53
54
54
::: zone pivot="github"
55
55
@@ -67,7 +67,7 @@ The issuer URL must be accessible from the AKS cluster nodes:
67
67
68
68
::: zone-end
69
69
70
-
2. Test network connectivity from a cluster node:
70
+
2. Test network connectivity from a cluster node.
71
71
72
72
::: zone pivot="github"
73
73
@@ -89,11 +89,11 @@ The issuer URL must be accessible from the AKS cluster nodes:
89
89
90
90
### Step 3: Inspect the JWT authenticator configuration
91
91
92
-
Review your JWT authenticator configuration for common issues:
92
+
Review your JWT authenticator configuration for common issues. Use the following steps.
93
93
94
94
1. Verify the issuer URL exactly matches the `iss` claim in your tokens.
95
95
2. Check that the audience claim in the configuration matches the `aud` claim in your tokens.
96
-
3. Ensure CEL (Common Expression Language) expressions in claim mappings are syntactically correct.
96
+
3. Ensure Common Expression Language (CEL) expressions in claim mappings are syntactically correct.
97
97
4. Confirm that all username and group mappings include the `aks:jwt:` prefix.
98
98
99
99
Example configuration:
@@ -175,11 +175,11 @@ Example configuration:
175
175
176
176
### Step 4: Decode and verify JWT tokens
177
177
178
-
To verify claims obtain and inspect the JWT token:
178
+
Verify claims and obtain and inspect the JWT token. Use the following steps.
179
179
180
180
::: zone pivot="github"
181
181
182
-
1. For GitHub Actions OIDC, tokens are typically obtained within a workflow. You can obtain a token for testing using:
182
+
1. For GitHub Actions OIDC, tokens are typically obtained within a workflow. Obtain a token.
183
183
184
184
```bash
185
185
# This is typically done within a GitHub Actions workflow
@@ -192,7 +192,7 @@ To verify claims obtain and inspect the JWT token:
192
192
193
193
::: zone pivot="google-identity"
194
194
195
-
1. Get a token from Google Identity:
195
+
1. Get a token from Google Identity.
196
196
197
197
```bash
198
198
kubectl oidc-login get-token \
@@ -203,19 +203,20 @@ To verify claims obtain and inspect the JWT token:
203
203
204
204
::: zone-end
205
205
206
-
2. Decode the token at [jwt.ms][jwt-ms] and verify:
207
-
- The `iss` claim matches your issuer URL exactly
208
-
- The `aud` claim matches your configured audience
209
-
- The token isn't expired (`exp` claim)
210
-
- Required claims for username and groups are present
211
-
- Claims match the format expected by your CEL expressions
206
+
2. Decode the token at [jwt.ms][jwt-ms] and verify the following:
207
+
208
+
- The `iss` claim matches your issuer URL exactly.
209
+
- The `aud` claim matches your configured audience.
210
+
- The token isn't expired (`exp` claim).
211
+
- Required claims for username and groups are present.
212
+
- Claims match the format expected by your CEL expressions.
212
213
213
214
### Step 5: Check AKS API server logs
214
215
215
-
Review the AKS API server logs for authentication errors:
216
+
Review the AKS API server logs for authentication errors. Use the following steps.
216
217
217
-
1. Use diagnostic settings to [enable resource logs][aks-resource-logs] for your AKS cluster. Choose 'Kubernetes API Server' when creating the diagnostic setting.
218
-
2. Check logs in Azure Monitor or Log Analytics for authentication failures.
218
+
1. Use diagnostic settings to [enable resource logs][aks-resource-logs] for your AKS cluster. Choose **Kubernetes API Server** when creating the diagnostic setting.
219
+
2. Check logs in Azure Monitor or Azure Log Analytics for authentication failures.
219
220
3. Look for error messages related to JWT validation or claim mapping.
220
221
221
222
## Common issues and solutions
@@ -226,9 +227,9 @@ Review the AKS API server logs for authentication errors:
226
227
227
228
The audience claim in the token doesn't match the configured audience in the JWT authenticator.
228
229
229
-
####Solution: Update the authenticator configuration
230
+
### Solution: Update the authenticator configuration
230
231
231
-
Verify the audience claim in your token and update the JWT authenticator configuration:
232
+
Verify the audience claim in your token and update the JWT authenticator configuration.
232
233
233
234
```azurecli-interactive
234
235
az aks jwtauthenticator update \
@@ -242,15 +243,15 @@ az aks jwtauthenticator update \
242
243
243
244
The issuer URL in the configuration doesn't exactly match the `iss` claim in the token.
244
245
245
-
####Solution: Correct the issuer URL
246
+
### Solution: Correct the issuer URL
246
247
247
248
Update the issuer URL in your JWT authenticator configuration file to match the exact issuer in your tokens, including the protocol (https://) and any trailing slashes.
248
249
249
250
**Cause 3: Identity provider misconfiguration**
250
251
251
252
The OAuth client or OIDC provider settings are incorrect.
252
253
253
-
####Solution: Verify identity provider settings
254
+
### Solution: Verify identity provider settings
254
255
255
256
::: zone pivot="github"
256
257
@@ -273,13 +274,13 @@ The OAuth client or OIDC provider settings are incorrect.
273
274
274
275
CEL expressions might have syntax errors or return unexpected data types.
275
276
276
-
####Solution: Validate CEL expressions
277
+
### Solution: Validate CEL expressions
277
278
278
279
1. Review the CEL expressions in your configuration.
279
280
2. Test expressions using a CEL evaluator to ensure they return strings for username and arrays of strings for groups.
280
281
3. Update the configuration with corrected expressions:
281
282
282
-
Example of a valid CEL expression for extracting groups:
283
+
The following is an example of a valid CEL expression for extracting groups:
283
284
284
285
```json
285
286
{
@@ -296,15 +297,15 @@ CEL expressions might have syntax errors or return unexpected data types.
296
297
297
298
Network security groups, firewalls, or Domain Name System (DNS) issues prevent the cluster from accessing the identity provider.
298
299
299
-
####Solution 1: Verify DNS resolution
300
+
### Solution 1: Verify DNS resolution
300
301
301
-
1. Connect to a cluster node using `kubectl debug`:
302
+
1. Connect to a cluster node using `kubectl debug`.
0 commit comments