# ovok_sdk.auth.client_credentials

Canonical page: https://docs.ovok.com/python-sdk/reference/auth/client_credentials

Machine-client authentication with the OAuth client-credentials grant.

## ClientCredentials [#clientcredentials]

```python
ClientCredentials(
    endpoint: TokenEndpoint,
    client: MachineClient,
    clock: Clock = epoch_ms,
)
```

A machine client's own token, fetched from the OAuth endpoint and renewed before it expires.

**Parameters**

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| `endpoint` | `TokenEndpoint` |  | The OAuth token endpoint. |
| `client` | `MachineClient` |  | The machine client's credentials. |
| `clock` | `Clock` | `epoch_ms` | Current time in epoch milliseconds. |

### access_token() [#access_token]

```python
access_token() -> str
```

Return a fresh access token, requesting a new one when the current one is stale.

### refresh() [#refresh]

```python
refresh() -> bool
```

Request a new token.

**Returns**

- `bool`: Always True; a failed request raises instead.
