# Google API Common Protos Client - Class Authentication (4.14.0)

4.14.0 (latest) 4.13.0 4.12.5 4.11.0 4.10.0 4.9.0 4.8.3 Reference documentation and code samples for the Google API Common Protos Client class Authentication.

`Authentication` defines the authentication configuration for API methods
provided by an API service.

Example:
name: calendar.googleapis.com
authentication:
providers:

- id: google_calendar_auth jwks_uri: <https://www.googleapis.com/oauth2/v1/certs> issuer: <https://securetoken.google.com> rules:
- selector: "\*" requirements: provider_id: google_calendar_auth
- selector: google.calendar.Delegate oauth: canonical_scopes: <https://www.googleapis.com/auth/calendar.read>

Generated from protobuf message `google.api.Authentication`

## Namespace

Google \\ Api

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ rules` | `array<https://docs.cloud.google.com/php/docs/reference/common-protos/latest/Api.AuthenticationRule>` A list of authentication rules that apply to individual API methods. **NOTE:** All service configuration rules follow "last one wins" order. |
| `↳ providers` | `array<https://docs.cloud.google.com/php/docs/reference/common-protos/latest/Api.AuthProvider>` Defines a set of authentication providers that a service supports. |

### getRules

A list of authentication rules that apply to individual API methods.

**NOTE:** All service configuration rules follow "last one wins" order.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/RepeatedField<https://docs.cloud.google.com/php/docs/reference/common-protos/latest/Api.AuthenticationRule>` |   |

### setRules

A list of authentication rules that apply to individual API methods.

**NOTE:** All service configuration rules follow "last one wins" order.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `array<https://docs.cloud.google.com/php/docs/reference/common-protos/latest/Api.AuthenticationRule>` |

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

### getProviders

Defines a set of authentication providers that a service supports.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/RepeatedField<https://docs.cloud.google.com/php/docs/reference/common-protos/latest/Api.AuthProvider>` |   |

### setProviders

Defines a set of authentication providers that a service supports.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `array<https://docs.cloud.google.com/php/docs/reference/common-protos/latest/Api.AuthProvider>` |

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