# Interface CredentialFactory (1.15.0)

<button class="button button-with-icon cloud-select-dropdown__button " aria-haspopup="true">Version latest</button>

- [1.15.0 (latest)](https://docs.cloud.google.com/java/docs/reference/jdbc-socket-factory-parent/latest/com.google.cloud.sql.CredentialFactory)
- [1.14.1](https://docs.cloud.google.com/java/docs/reference/jdbc-socket-factory-parent/1.14.1/com.google.cloud.sql.CredentialFactory)

    public interface CredentialFactory

Factory for creating Credentials for interaction with Cloud SQL Admin API.

## Static Fields

### CREDENTIAL_FACTORY_PROPERTY

    public static final String CREDENTIAL_FACTORY_PROPERTY

Name of system property that can specify an alternative credential factory.

| **Field Value** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` |   |

## Methods

### create()

    public abstract HttpRequestInitializer create()

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `com.google.api.client.http.HttpRequestInitializer` |   |

### getCredentials()

    public default GoogleCredentials getCredentials()

Returns a GoogleCredentials to use for generating tokens and authenticating web requests. The
default implementation will attempt to extract the GoogleCredentials object from known
credential HttpRequestInitializer implementations already in used to provide tokens for IAM
Authentication.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `com.google.auth.oauth2.GoogleCredentials` |   |