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
fix(auth): resolve tenant from az cli, clear stale audiences, normalize issuer
Three fixes discovered during end-to-end azd up testing:
1. `az containerapp auth microsoft update` rejects `--issuer` and
`--tenant-id` together; the issuer is derived from tenant-id.
2. `azd env get-value AZURE_TENANT_ID` prints its error message to stdout
(not stderr), corrupting TENANT_ID when that key is absent. Read from
`az account show` first instead.
3. `--allowed-token-audiences api://<clientId>` breaks EasyAuth login
because the ID tokens it issues have `aud=<clientId>` (GUID), not the
identifierUri. Drop the override and normalize `allowedAudiences` to
just the clientId via an authConfig PUT (which also clears stale
values left by prior runs and fixes `openIdIssuer` if it was
previously corrupted).
Verified: Web `/.auth/login/aad` -> 302 to login.microsoftonline.com with
the correct client_id, redirect_uri, and scopes; API returns 401 to
unauthenticated callers; allowedApplications on the API restricts callers
to the Web clientId.
# - Both: reset allowedAudiences to only the clientId, normalize openIdIssuer
329
+
patch_authconfig() {
330
+
local ca_name="$1"
331
+
local client_id="$2"
332
+
local add_web_allowed="$3"# "true" / "false"
333
+
local url="/subscriptions/${SUBSCRIPTION_ID}/resourceGroups/${RESOURCE_GROUP}/providers/Microsoft.App/containerApps/${ca_name}/authConfigs/current?api-version=2024-03-01"
0 commit comments