[[["容易理解","easyToUnderstand","thumb-up"],["確實解決了我的問題","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["難以理解","hardToUnderstand","thumb-down"],["資訊或程式碼範例有誤","incorrectInformationOrSampleCode","thumb-down"],["缺少我需要的資訊/範例","missingTheInformationSamplesINeed","thumb-down"],["翻譯問題","translationIssue","thumb-down"],["其他","otherDown","thumb-down"]],["上次更新時間:2025-09-04 (世界標準時間)。"],[],[],null,["# Authentication\n\nGKE on AWS supports the following authentication methods:\n\n- Connect\n- OpenID Connect (OIDC).\n\nConnect\n-------\n\nTo log in using the Google Cloud console with Connect,\nGKE on AWS can use a Kubernetes service account's bearer token. For\nmore information, see\n[Logging in to a cluster from the Google Cloud console](/kubernetes-engine/multi-cloud/docs/aws/previous-generation/how-to/connecting-to-a-cluster).\n\n### The Kubernetes API server and the ID token\n\nAfter authenticating with the cluster, you can interact using the `kubectl` CLI\nof gcloud CLI. When `kubectl` calls the Kubernetes API server on behalf\nof the user, the API server verifies the token by using the OpenID provider's\npublic certificate. Then the API server parses the token to learn the user's\nidentity and the user's security groups.\n\nThe API server determines whether the user is authorized to make this particular\ncall by comparing the user's security groups to the cluster's\n[role-based Access Control](https://kubernetes.io/docs/reference/access-authn-authz/rbac/)\n(RBAC) policy.\n\nOIDC\n----\n\nGKE on AWS supports OIDC authentication with the\n[GKE Identity Service](/anthos/identity). GKE Identity Service\nsupports many identity providers. For more information, see\n[Supported identity providers](/anthos/identity#supported_identity_providers).\n\n### Overview\n\nWith OIDC, you can manage access to a cluster with the standard procedures in\nyour organization for creating, enabling, and disabling employee accounts. You\ncan also use your organization's security groups to configure access to a\nKubernetes cluster or to specific services in the cluster.\n\nA typical OIDC login flow follows:\n\n- A user signs in to an OpenID provider by presenting a username and\n password.\n\n- The OpenID provider signs and issues an ID token for the user.\n\n- The gcloud CLI sends an HTTPS request to the Kubernetes API server.\n The application includes the user's ID token in the request header.\n\n- The Kubernetes API server verifies the token by using the provider's\n certificate.\n\n### Signing in with the gcloud CLI\n\nYou run the `gcloud anthos auth login` command to authenticate with your\nclusters. The gcloud CLI authenticates your request to the Kubernetes\nAPI server.\n\nTo use the gcloud CLI, your OIDC ID tokens must be stored in the\n[`kubeconfig` file](https://kubernetes.io/docs/tasks/access-application-cluster/configure-access-multiple-clusters/).\nYou add tokens to your `kubeconfig` file with\n[`gcloud anthos create-login-config`](/kubernetes-engine/multi-cloud/docs/aws/previous-generation/how-to/oidc#create_a_login_config).\nGKE on AWS uses the gcloud CLI to request and\nobtain the ID token and other OIDC values in the `kubeconfig` file."]]