Skip to content

OIDC Authentication Support and Tests #105

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

ziadmoubayed
Copy link
Contributor

Add OIDC Authentication Support

Summary

Enhanced the Kubernetes MCP server to support OIDC (OpenID Connect) authentication alongside existing bearer token authentication methods.

Changes

  • Added OIDC plugin import: Registered the official Kubernetes client-go OIDC auth provider plugin
  • Enhanced ConfigurationView: Extended in-cluster configuration view to properly handle OIDC auth providers and exec providers alongside bearer tokens
  • Improved Derived method: Preserved OIDC authentication configuration when no bearer token override is provided, ensuring seamless fallback to configured OIDC settings
  • Comprehensive test coverage: Added extensive test suite covering OIDC configuration preservation, bearer token overrides, and edge cases

Technical Details

  • Leverages the standard k8s.io/client-go/plugin/pkg/client/auth/oidc plugin for automatic OIDC token management
  • Maintains backward compatibility with existing bearer token authentication
  • Follows Kubernetes client-go best practices for multi-auth-provider support

Testing

All existing tests pass, plus new comprehensive test coverage for OIDC scenarios including configuration preservation, auth provider handling, and multi-auth-method support.

Disclaimer

Wrote the code with claude. Tested locally with oidc server. Works well.

@ziadmoubayed
Copy link
Contributor Author

@manusa claude generated this code for me. Tested with oidc server: works well 🍏

@ardaguclu
Copy link
Contributor

/hold
Until we ensure that the correct path

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants