-
Notifications
You must be signed in to change notification settings - Fork 2
Improve registry authentication documentation #394
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
- Clarify OAuth mode supports both JWT and opaque tokens - Add introspectionUrl field to provider configuration table - Add opaque token configuration example using Google - Update terminology from OIDC-compliant to OAuth-compliant
Move JWT-specific signature verification details under a separate paragraph that distinguishes between JWT and opaque token validation methods.
- Update provider config with correct issuerUrl (.cluster.local suffix) - Add jwksUrl, authTokenFile, and allowPrivateIP fields to config table - Add client workload example with projected service account tokens - Replace legacy kubectl get secret with kubectl create token - Add tip explaining projected tokens vs kubectl create token - Update "How it works" section to reflect audience-based auth
- Add note about WWW-Authenticate header in RFC 9728 section - Clarify that scopesSupported is for discovery endpoint advertisement
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR improves the registry authentication documentation based on hands-on testing with a Kubernetes cluster. The changes address critical inaccuracies in the OAuth token support description and Kubernetes authentication configuration, while adding practical examples for client workloads.
Key changes:
- Clarified that OAuth mode supports both JWT tokens (via JWKS) and opaque tokens (via introspection), not just JWT
- Fixed Kubernetes authentication configuration with correct issuerUrl, added missing fields (jwksUrl, authTokenFile, allowPrivateIP), and replaced legacy token retrieval commands
- Added new sections for opaque token configuration and client workload examples with projected service account tokens
|
|
||
| 1. Workloads in the cluster mount service account tokens automatically at | ||
| `/var/run/secrets/kubernetes.io/serviceaccount/token` | ||
| 1. Workloads mount projected service account tokens with a specific audience |
Copilot
AI
Dec 12, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the "How Kubernetes authentication works" step 1, the phrase "Workloads mount projected service account tokens" could be clearer. Consider revising to "Workloads mount projected service account tokens (configured with a specific audience)" to make it clear that this requires configuration, as shown in the client workload example below.
| 1. Workloads mount projected service account tokens with a specific audience | |
| 1. Workloads mount projected service account tokens (configured with a specific audience) |
Summary
This PR improves the registry authentication documentation based on hands-on testing with a Kind cluster. The main changes address several issues found during review:
kubectl get secretexample used a legacy approach that produces tokens incompatible with the documented OAuth setupRelated server changes: stacklok/toolhive-registry-server#298
Changes
OAuth token type support
introspectionUrlKubernetes authentication overhaul
issuerUrl- K8s tokens usehttps://kubernetes.default.svc.cluster.local(with the.cluster.localsuffix), nothttps://kubernetes.default.svcjwksUrl,authTokenFile,allowPrivateIPkubectl get secretexample withkubectl create tokenMinor improvements
WWW-Authenticateheader behavior for 401 responsesscopesSupportedis currently only advertised in the discovery endpointTesting
Tested in a Kind cluster by deploying the registry server with Kubernetes OAuth authentication enabled. The setup used projected service account tokens with a custom audience (
registry-server) to verify that audience-based access control works correctly.Registry server config:
Client workload with projected token:
Verified that clients with tokens issued for the correct audience can access the registry, while clients using the default Kubernetes service account token (wrong audience) are rejected with 401. Also confirmed that requests without tokens or with invalid tokens are properly rejected.
The key finding was that the legacy
kubectl get secretapproach produces tokens with issuerkubernetes/serviceaccount, which doesn't match the expectedissuerUrl. Only the modernkubectl create tokenapproach (or projected tokens) produces tokens compatible with the OAuth configuration.