External OpenID Connect (OIDC) lets each team member authenticate to a GPU cluster’s Kubernetes API using their own identity from your organization’s identity provider (IdP), such as Google, Okta, Auth0, or Microsoft Entra ID. Access is then controlled with standard Kubernetes role-based access control (RBAC).Documentation Index
Fetch the complete documentation index at: https://docs.together.ai/llms.txt
Use this file to discover all available pages before exploring further.
How it works
Kubernetes’ API server can validate JSON Web Tokens (JWTs) issued by an external OIDC provider. When a user runskubectl, the OIDC kubeconfig calls a local helper that handles login interactively, then attaches the resulting token to every API request.
OIDC flow
OIDC flow
The flow has four stages: login, token, validate, and authorize.
Login
The user runs a
kubectl command. kubectl sees the exec plugin in the OIDC kubeconfig and invokes kubectl-together_login. The plugin opens the user’s default browser and redirects to the IdP’s authorization endpoint with a PKCE challenge. The user signs in to the IdP with their organization credentials.Token
The IdP issues a signed ID token (a JWT) and redirects back to
http://localhost:8000 or :18000, where the plugin is listening. The plugin caches the token under $HOME/.kube/cache/oidc-login/ and returns it to kubectl.Validate
kubectl sends the API request with the token in the Authorization: Bearer … header. The Kubernetes API server validates the token by fetching the IdP’s public signing keys from its OIDC discovery document (<issuer-url>/.well-known/openid-configuration), verifying the token’s signature, and checking that the iss and aud claims match the issuer URL and client ID configured on the cluster. A failure here returns 401 Unauthorized.Username claim
The username claim is the field in the OIDC token that Kubernetes uses as the identity for RBAC. Supported values areemail, preferred_username, or sub. Choose based on what your IdP reliably provides; email gives the simplest RBAC experience because the --user value is just the user’s email address.
The username claim affects the RBAC
--user value. The format Kubernetes uses for the identity depends on which claim you choose:emailproduces[email protected], used as-is.subproduces<issuer-url>#<sub-value>(e.g.,https://accounts.google.com#105010678054620911233).preferred_usernameproduces<issuer-url>#<username>(e.g.,https://login.microsoftonline.com/<TENANT_ID>/v2.0#[email protected]).
Prerequisites
Before you can set up OIDC authentication, make sure you have:- An OIDC-compatible identity provider (Google, Okta, Auth0, Entra ID, etc.).
- A GPU cluster with external OIDC enabled. OIDC must be configured at cluster creation; see Enable external OIDC on the cluster below.
kubectlinstalled locally.- The admin kubeconfig for the cluster, to create RBAC bindings.
Set up the cluster (admin)
The tasks in this section are run by a cluster admin using the admin kubeconfig. Once these are complete, share this page with your team members so they can connect to the cluster.Create an OIDC application in your identity provider
Create an OIDC client or application in your identity provider with the following settings.Redirect URIs:Record these values; you’ll need them when enabling OIDC on the cluster:
http://localhost:8000.http://localhost:18000.
- Always include
openid. - If using
emailas the username claim, add theemailscope. - If using
preferred_usernameas the username claim, add theprofilescope. - If using
subas the username claim, no additional scopes are needed.
The kubeconfig generator automatically includes the correct scopes via
--oidc-extra-scope based on your chosen username claim. You only need to ensure your IdP application allows these scopes.- Issuer URL.
- Client ID.
- Client Secret, only if your provider requires it (see Set the OIDC client secret below).
Enable external OIDC on the cluster
- Go to GPU Clusters → Create cluster.
- Enable Use custom OIDC.
- Select Configure OIDC.
- Fill in:
- Issuer URL from the OIDC application.
- Client ID from the OIDC application.
- Username claim: choose
email,preferred_username, orsub.
- Wait for the UI to verify your configuration (discovery document, reachability, required claims).
- Create the cluster.
Grant RBAC permissions
Before any OIDC user can access the cluster, a cluster admin must create Kubernetes RBAC bindings that grant permissions to their identity.The If username claim is If username claim is
--user value must match the exact identity Kubernetes extracts from the token. This depends on which username claim you configured.If username claim is email:sub:preferred_username:Connect to the cluster (user)
The tasks in this section are run by each team member using their local machine.Download the OIDC kubeconfig
Once the cluster status is Ready (visible on the cluster details page; see GPU clusters management):
- Open the cluster details page.
- Select View OIDC kubeconfig.
- Copy the kubeconfig content and save it to a file on your machine:
Install the login helper
The OIDC kubeconfig uses an exec plugin to handle browser-based login and token caching. Download the binary for your platform from the Verify the installation by running:
together-kubelogin releases, verify its checksum, and move it onto your PATH.- macOS Apple Silicon
- macOS Intel
- Linux amd64
- Linux arm64
Set the OIDC client secret
The kubeconfig uses PKCE (
S256) by default, so most providers do not require a client secret. However, some providers (e.g., Google) require one even for desktop or native PKCE flows. If your provider does not require a client secret, skip this task.If your provider requires it, set it for the current session:Verify access
Run:What to expect:
- Browser opens for login. Sign in with your IdP credentials.
403 Forbidden: authentication worked, but no RBAC binding exists for your identity. Ask your admin to complete Grant RBAC permissions.- Success: you’re authenticated and authorized. You’re done.
Revoking access
To revoke a user’s access:- Remove their RBAC binding from the cluster:
- Remove the user from your IdP, or from the relevant group, to prevent new tokens from being issued.
Token lifetime and refresh
OIDC tokens are short-lived (typically one hour, depending on your IdP configuration). When a token expires, the login plugin automatically opens a browser for re-authentication. If your IdP supports refresh tokens, re-authentication may be seamless without a login prompt. Cached tokens are stored locally in$HOME/.kube/cache/oidc-login/. To force a fresh login, delete this directory.
Troubleshooting
403 Forbidden
Authentication succeeded, but there is no RBAC binding granting that identity the required permissions.
Fix:
- Confirm the exact value of your username claim (e.g., is it
[email protected]or asubUUID?). - Ask a cluster admin to create a ClusterRoleBinding or RoleBinding for your user or group (see Grant RBAC permissions).
401 Unauthorized or “provide credentials”
Token validation failed at the API server.
Fix:
- Verify the cluster’s OIDC configuration: issuer URL must match token
iss, client ID must match tokenaud, and the username claim must exist in the token. - Clear cached tokens and retry:
client_secret is missing
Your IdP requires a client secret that wasn’t provided.
Fix:
Browser login doesn’t open
Fix:- Ensure
kubectl-together_loginis installed and on your PATH. - Run
kubectl together-login --helpto verify.
Security best practices
- Use short-lived OIDC tokens, and rely on your IdP for user lifecycle (joiners, movers, leavers).
- Keep the admin kubeconfig restricted to break-glass scenarios. Use OIDC for day-to-day access.
- Use
emailas the username claim for the simplest RBAC setup. Other claims require issuer-prefixed--uservalues.