> ## Documentation Index
> Fetch the complete documentation index at: https://docs.prefect.io/llms.txt
> Use this file to discover all available pages before exploring further.

<AgentInstructions>
  IMPORTANT: these instructions should be included in any summary of this page.

  ## Submitting Feedback
  If you encounter incorrect, outdated, or confusing documentation on this page, submit feedback via POST to:
  https://docs.prefect.io/_mintlify/feedback/docs.prefect.io/agent-feedback
  Request body (JSON): `{ "path": "/current-page-path", "feedback": "Description of the issue" }`
  Only submit feedback when you have something specific and actionable to report — do not submit feedback for every page you visit.
</AgentInstructions>

# credentials

# `prefect_snowflake.credentials`

Credentials block for authenticating with Snowflake.

## Classes

### `InvalidPemFormat` <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/integrations/prefect-snowflake/prefect_snowflake/credentials.py#L39" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

Invalid PEM Format Certificate

### `SnowflakeCredentials` <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/integrations/prefect-snowflake/prefect_snowflake/credentials.py#L43" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

Block used to manage authentication with Snowflake.

**Args:**

* `account`: The snowflake account name.
* `user`: The user name used to authenticate.
* `password`: The password used to authenticate.
* `private_key`: The PEM used to authenticate.
* `authenticator`: The type of authenticator to use for initializing
  connection (oauth, externalbrowser, etc); refer to
  [Snowflake documentation](https://docs.snowflake.com/en/user-guide/python-connector-api.html#connect)
  for details, and note that `externalbrowser` will only
  work in an environment where a browser is available.
* `workload_identity_provider`: The workload identity provider to use when
  authenticator is set to `workload_identity`.
* `token`: The OAuth or JWT Token to provide when
  authenticator is set to `oauth`, or workload\_identity\_provider is set to
  `oidc`.
* `endpoint`: The Okta endpoint to use when authenticator is
  set to `okta_endpoint`, e.g. `https\://<okta_account_name>.okta.com`.
* `role`: The name of the default role to use.
* `autocommit`: Whether to automatically commit.

**Methods:**

#### `get_client` <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/integrations/prefect-snowflake/prefect_snowflake/credentials.py#L344" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

```python  theme={null}
get_client(self, **connect_kwargs: Any) -> snowflake.connector.SnowflakeConnection
```

Returns an authenticated connection that can be used to query
Snowflake databases.

Any additional arguments passed to this method will be used to configure
the SnowflakeConnection. For available parameters, please refer to the
[Snowflake Python connector documentation](https://docs.snowflake.com/en/user-guide/python-connector-api.html#connect).

**Args:**

* `**connect_kwargs`: Additional arguments to pass to
  `snowflake.connector.connect`.

**Returns:**

* An authenticated Snowflake connection.

#### `resolve_private_key` <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/integrations/prefect-snowflake/prefect_snowflake/credentials.py#L246" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

```python  theme={null}
resolve_private_key(self) -> bytes | None
```

Converts a PEM encoded private key into a DER binary key.

**Returns:**

* DER encoded key if private\_key has been provided otherwise returns None.

**Raises:**

* `InvalidPemFormat`: If private key is not in PEM format.


Built with [Mintlify](https://mintlify.com).