Diagram

A sequence diagram with App, Connector, IAM, and Database lifelines showing five steps: app sends username only, connector requests OAuth token, IAM returns 1-hour token, connector logs in with token over TLS, then session stays open with auto-refresh.
Automatic Versus Manual Token Handling and Choosing Authentication
Automatic versus manual token handling describes two ways to deliver the temporary IAM token to the database. With automatic IAM database authentication, a connector requests and manages tokens on behalf of the client, so the application passes only the IAM database username and the connector submits the token in the password field. With manual authentication, the principal signs in to Google Cloud, explicitly requests the token, and passes the token as the password with the email address as username.
The connector path depends on the service but follows the same flow from client to IAM to database. For Cloud SQL, automatic authentication requires a Cloud SQL connector such as the Auth Proxy or Go, Java, or Python connectors. For AlloyDB, automatic authentication uses the AlloyDB Auth Proxy or an AlloyDB Language Connector, which authorizes with IAM and protects traffic with mTLS. Because OAuth 2.0 tokens expire after one hour, new manual connections fail unless a fresh token is supplied, so automatic authentication is strongly recommended for long-lived processes and pooling. If context-aware access is used, a connector cannot be used with IAM database authentication and the client must connect directly.
Domain 1 of 5
42 practice questions
Practice this DomainLast updated