Exchange Flow: apiserver 401s the exchanged token even though the RFC 8693 exchange succeeds #45
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
lab/authz-bridge#45
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Symptom
A kubectl request carrying a Kanidm Service Account Token (SAT) through the k8s-hub gateway returns 401 Unauthorized.
The bridge log shows
Served the Exchange Check— the RFC 8693 exchange succeeded and the exchanged token was injected into theAuthorizationheader — but the k8s API server rejects the exchanged token.So the machine/Exchange Flow works up to the bridge; the failure is at the apiserver's token validation.
Context
clientID=portablecluster(the audience), scopesopenid groups_name(from theTokenExchangePolicy).--oidc-client-idisportableclusterand--oidc-issuer-urlishttps://auth.animeteamspeak.moe/oauth2/openid/portablecluster(per the kubelogin config in~/.kube/config).access_deniedwas a missing group membership, now resolved — the exchange itself succeeds).Open questions (to be grilled)
iss/audactually match the apiserver's--oidc-issuer-url/--oidc-client-id? (The token endpoint is shared across clients; confirm theissKanidm stamps on an exchanged token for this client.)--oidc-username-claim,--oidc-groups-claim,--oidc-groups-prefix)? Does the exchanged token carry them (e.g.groups_name)?