---
title: "Returns credentials for the user to authenticate to the cluster."
method: POST
path: "/projects/{project_id}/kubernetes/clusters/{cluster_id}/get-credentials"
tags: ["Kubernetes Clusters"]
---

# Returns credentials for the user to authenticate to the cluster.

`POST /projects/{project_id}/kubernetes/clusters/{cluster_id}/get-credentials`

## Path parameters

- `project_id` string, required
- `cluster_id` string, required

## Query parameters

- `auth_type` 'oidc' | 'admin_cert'

## Response `200`

- KubernetesAuthenticationDetails — It supports both the new kubeconfig-based and legacy certificate-based authentication.
  - `cluster_address` string, required — Address of the Kubernetes cluster to authenticate to.
  - `cluster_ca_certificate` string, required — CA certificate of the Kubernetes cluster to authenticate to.
  - `cluster_name` string, required — Name of the Kubernetes cluster to authenticate to.
  - `kube_config` string — Kubeconfig for the Kubernetes cluster to authenticate to.
  - `user_client_certificate` string, required — Client certificate the user presents to authenticate to the cluster.
  - `user_client_key` string, required — Private key associated with the user's client certificate.
  - `user_name` string, required — Name of the authenticating user.

## Other responses

- `400` — Error Bad Request
- `401` — Error Authentication Failed
- `403` — Error Permissions
- `500` — Error Internal Server

---

[API](https://skmtc.dev/crusoecloud/apis/crusoe-cloud-api-gateway.md) · [All operations](https://skmtc.dev/crusoecloud/apis/crusoe-cloud-api-gateway/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/crusoecloud/crusoe-cloud-api-gateway/revisions/a3fd2dedc72b/schema)
