# Google Cloud Container V1 Client - Class MasterAuth (2.10.0)

2.10.0 (latest) 2.9.0 2.8.1 2.7.0 2.6.1 2.5.0 2.4.0 2.3.4 2.2.1 2.1.0 2.0.0 1.33.0 1.32.0 1.31.0 1.30.3 1.24.0 1.23.0 1.22.0 1.21.1 1.20.0 1.19.0 1.18.0 1.17.1 1.16.0 1.15.0 1.14.0 1.13.1 1.12.1 1.10.3 1.9.1 Reference documentation and code samples for the Google Cloud Container V1 Client class MasterAuth.

The authentication information for accessing the master endpoint.

Authentication can be done using HTTP basic auth or using client
certificates.

Generated from protobuf message `google.container.v1.MasterAuth`

## Namespace

Google \\ Cloud \\ Container \\ V1

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ username` | `string` The username to use for HTTP basic authentication to the master endpoint. For clusters v1.6.0 and later, basic authentication can be disabled by leaving username unspecified (or setting it to the empty string). Warning: basic authentication is deprecated, and will be removed in GKE control plane versions 1.19 and newer. For a list of recommended authentication methods, see: <https://cloud.google.com/kubernetes-engine/docs/how-to/api-server-authentication> |
| `↳ password` | `string` The password to use for HTTP basic authentication to the master endpoint. Because the master endpoint is open to the Internet, you should create a strong password. If a password is provided for cluster creation, username must be non-empty. Warning: basic authentication is deprecated, and will be removed in GKE control plane versions 1.19 and newer. For a list of recommended authentication methods, see: <https://cloud.google.com/kubernetes-engine/docs/how-to/api-server-authentication> |
| `↳ client_certificate_config` | `https://docs.cloud.google.com/php/docs/reference/cloud-container/latest/V1.ClientCertificateConfig` Configuration for client certificate authentication on the cluster. For clusters before v1.12, if no configuration is specified, a client certificate is issued. |
| `↳ cluster_ca_certificate` | `string` Output only. Base64-encoded public certificate that is the root of trust for the cluster. |
| `↳ client_certificate` | `string` Output only. Base64-encoded public certificate used by clients to authenticate to the cluster endpoint. Issued only if client_certificate_config is set. |
| `↳ client_key` | `string` Output only. Base64-encoded private key used by clients to authenticate to the cluster endpoint. |

### getUsername

The username to use for HTTP basic authentication to the master endpoint.

For clusters v1.6.0 and later, basic authentication can be disabled by
leaving username unspecified (or setting it to the empty string).
Warning: basic authentication is deprecated, and will be removed in GKE
control plane versions 1.19 and newer. For a list of recommended
authentication methods, see:
<https://cloud.google.com/kubernetes-engine/docs/how-to/api-server-authentication>

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string` |   |

### setUsername

The username to use for HTTP basic authentication to the master endpoint.

For clusters v1.6.0 and later, basic authentication can be disabled by
leaving username unspecified (or setting it to the empty string).
Warning: basic authentication is deprecated, and will be removed in GKE
control plane versions 1.19 and newer. For a list of recommended
authentication methods, see:
<https://cloud.google.com/kubernetes-engine/docs/how-to/api-server-authentication>

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `string` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getPassword

The password to use for HTTP basic authentication to the master endpoint.

Because the master endpoint is open to the Internet, you should create a
strong password. If a password is provided for cluster creation, username
must be non-empty.
Warning: basic authentication is deprecated, and will be removed in GKE
control plane versions 1.19 and newer. For a list of recommended
authentication methods, see:
<https://cloud.google.com/kubernetes-engine/docs/how-to/api-server-authentication>

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string` |   |

### setPassword

The password to use for HTTP basic authentication to the master endpoint.

Because the master endpoint is open to the Internet, you should create a
strong password. If a password is provided for cluster creation, username
must be non-empty.
Warning: basic authentication is deprecated, and will be removed in GKE
control plane versions 1.19 and newer. For a list of recommended
authentication methods, see:
<https://cloud.google.com/kubernetes-engine/docs/how-to/api-server-authentication>

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `string` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getClientCertificateConfig

Configuration for client certificate authentication on the cluster. For
clusters before v1.12, if no configuration is specified, a client
certificate is issued.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-container/latest/V1.ClientCertificateConfig|null` |   |

### hasClientCertificateConfig

### clearClientCertificateConfig

### setClientCertificateConfig

Configuration for client certificate authentication on the cluster. For
clusters before v1.12, if no configuration is specified, a client
certificate is issued.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-container/latest/V1.ClientCertificateConfig` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getClusterCaCertificate

Output only. Base64-encoded public certificate that is the root of
trust for the cluster.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string` |   |

### setClusterCaCertificate

Output only. Base64-encoded public certificate that is the root of
trust for the cluster.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `string` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getClientCertificate

Output only. Base64-encoded public certificate used by clients to
authenticate to the cluster endpoint. Issued only if
client_certificate_config is set.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string` |   |

### setClientCertificate

Output only. Base64-encoded public certificate used by clients to
authenticate to the cluster endpoint. Issued only if
client_certificate_config is set.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `string` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getClientKey

Output only. Base64-encoded private key used by clients to authenticate
to the cluster endpoint.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string` |   |

### setClientKey

Output only. Base64-encoded private key used by clients to authenticate
to the cluster endpoint.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `string` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |