Skip to content

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
Member

/hold
Until we ensure that the correct path

@ardaguclu
Copy link
Member

/close

@manusa
Copy link
Member

manusa commented Aug 1, 2025

Thanks @ziadmoubayed for giving this a try and moving this forward.
We finally implemented OIDC as HTTP middleware. This PR is not applicable anymore. Closing.

@manusa manusa closed this Aug 1, 2025
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.

3 participants