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.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-28 UTC."],[],[],null,["# Interface CredentialFactory (1.15.0)\n\nVersion latestkeyboard_arrow_down\n\n- [1.15.0 (latest)](/java/docs/reference/jdbc-socket-factory-parent/latest/com.google.cloud.sql.CredentialFactory)\n- [1.14.1](/java/docs/reference/jdbc-socket-factory-parent/1.14.1/com.google.cloud.sql.CredentialFactory) \n\n public interface CredentialFactory\n\nFactory for creating Credentials for interaction with Cloud SQL Admin API.\n\nStatic Fields\n-------------\n\n### CREDENTIAL_FACTORY_PROPERTY\n\n public static final String CREDENTIAL_FACTORY_PROPERTY\n\nName of system property that can specify an alternative credential factory.\n\nMethods\n-------\n\n### create()\n\n public abstract HttpRequestInitializer create()\n\n### getCredentials()\n\n public default GoogleCredentials getCredentials()\n\nReturns a GoogleCredentials to use for generating tokens and authenticating web requests. The\ndefault implementation will attempt to extract the GoogleCredentials object from known\ncredential HttpRequestInitializer implementations already in used to provide tokens for IAM\nAuthentication."]]