Skip to main content
If users can’t sign in to a Managed Service for Kubernetes cluster with an external OpenID Connect (OIDC) identity provider (IdP), or you can’t add or update a provider, check the causes below. For an overview of how OIDC authentication works, see Authentication with external OIDC providers in Managed Service for Kubernetes®. If no OIDC user can sign in, connect to the cluster with your Nebius AI Cloud credentials and fix the provider configuration. For instructions, see How to configure external OIDC providers in Managed Service for Kubernetes®.

How to find the cause of an error

To see how the cluster authenticates a user, run the following command with the kubeconfig file of the user:
Use the output to find the cause:
  • If kubectl can’t get a token from the IdP, see Sign-in errors.
  • If the output is error: You must be logged in to the server (Unauthorized), the API server rejected the token. See Unauthorized error.
  • If the output shows the username and groups of the user, the user is authenticated. If the user still can’t run commands, compare the username and groups with your role-based access control (RBAC) bindings. See Forbidden error.
If you sign in with a kubeconfig file from your cluster administrator and can’t fix the error yourself, send the administrator the error message and the output of this command.

Configuration rejected by the cluster

The cluster checks the provider configuration before it applies it. The error message names the parameter that failed the check. Common causes:
  • The cluster runs an unrecommended Kubernetes version.
  • A prefix starts with system: or nebius:.
  • Two providers have the same name or the same issuer URL.
  • The issuer URL doesn’t use HTTPS, contains a query or a fragment, or points to the cluster itself.
  • A claim mapping has both claim and expression, or an expression mapping has a prefix.
  • A claim validation rule has both claim and expression, an exact-match rule has a message, or an expression rule has a required_value.
  • A Common Expression Language (CEL) expression doesn’t compile.
  • An expression uses claims.email without checking email_verified.
  • issuer.certificate_authority isn’t a valid PEM bundle.
  • The cluster has more than 64 providers.

Sign-in errors

The user can’t complete the sign-in, so kubectl doesn’t get a token. Check that the user is assigned to the client application in the IdP. If users sign in with kubelogin, also check the following:
  • kubelogin is installed. If it isn’t, kubectl reports that the oidc-login command is unknown. For instructions, see How to sign in to the cluster.
  • The client application in the IdP allows the authorization code grant type and the http://localhost:8000 redirect URI. If it doesn’t, the IdP shows an error after the user signs in.
  • The --oidc-issuer-url and --oidc-client-id values in the kubeconfig file match the issuer URL of the IdP and the client ID of the application.
If users sign in with a different client, check its settings according to its documentation.

Unauthorized error

The API server rejected the token. Check the following:
  • The update operation that added or changed the provider has completed.
  • The issuer URL and the discovery document are publicly accessible over HTTPS.
  • The issuer field of the discovery document matches issuer.url exactly, including the trailing slash. To see the document, open <issuer_URL>/.well-known/openid-configuration in a browser.
  • The public keys of the IdP include the key that signed the token.
  • The token hasn’t expired.
  • The aud claim of the token contains one of the values in issuer.audiences.
  • The token contains the claims that the mappings use, and email_verified isn’t false.
  • The token passes all validation rules.
  • The mapped username and groups don’t start with system:.
To see the claims of a token from your IdP with kubelogin, run the following command and sign in:

Forbidden error

The user is authenticated but has no permission for the request. Get the mapped username and groups of the user and check the following:
  • Your RBAC bindings use the same names as the output, including the prefixes. For more information, see How to grant access with RBAC.
  • If the output has no groups from the IdP, the ID token has no groups claim. Configure the IdP to add the claim. If the IdP adds it only for a separate scope, request this scope in the kubeconfig file. For more information, see How to prepare a kubeconfig file for users.