OIDC Flow ignores presented bearer tokens (kubelogin/kubectl gets a 302 to login) #44
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
lab/authz-bridge#44
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
kubectl get nodesthrough the k8s-hub gateway (auth via kubelogin) fails with:kubectl is receiving an HTML page — a 302 redirect to the Kanidm login — instead of a JSON API response.
Root cause (as understood)
internal/serve/oidc.goCheck()only reads the session cookie (sessionTokens()→cookieheader). It never inspects theAuthorizationheader. A token-presenting client (kubectl/kubelogin, which has no session cookie) falls straight through torelogin()→ 302.The OIDC Flow was designed for browser sessions only (cookie + lazy refresh). It has no path for a client that presents a bearer token directly.
Proposed direction (to be grilled)
Add a token-presentation path to the OIDC Flow, before the cookie check:
Authorization: Bearertoken.Authorizationheader, letting the apiserver's own--oidc-*config do the final authorization.Open questions
newIDTokenVerifier) is id_token-oriented; both are ES256 from the same Kanidm JWKS and carryiss/aud, but we should confirm which type Kanidm actually returns to kubelogin before picking the validation path.