# Stackdriver Monitoring V3 Client - Class BasicAuthentication (2.2.2)

2.2.2 (latest) 2.2.1 2.1.2 2.0.1 1.12.1 1.11.1 1.10.3 1.9.0 1.8.0 1.7.1 1.6.0 1.5.1 1.4.0 1.3.2 1.2.2 Reference documentation and code samples for the Stackdriver Monitoring V3 Client class BasicAuthentication.

The authentication parameters to provide to the specified resource or
URL that requires a username and password. Currently, only
[Basic HTTP authentication](https://tools.ietf.org/html/rfc7617) is
supported in Uptime checks.

Generated from protobuf message `google.monitoring.v3.UptimeCheckConfig.HttpCheck.BasicAuthentication`

## Namespace

Google \\ Cloud \\ Monitoring \\ V3 \\ UptimeCheckConfig \\ HttpCheck

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ username` | `string` The username to use when authenticating with the HTTP server. |
| `↳ password` | `string` The password to use when authenticating with the HTTP server. |

### getUsername

The username to use when authenticating with the HTTP server.

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

### setUsername

The username to use when authenticating with the HTTP server.

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

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

### getPassword

The password to use when authenticating with the HTTP server.

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

### setPassword

The password to use when authenticating with the HTTP server.

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

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