skip to main content
Using the driver : Authentication : Configuring service account authentication
  

Try DataDirect Drivers Now

Configuring service account authentication

The driver supports service account authentication. A service account is a type of Google account that represents an application instead of an individual end user. Unlike a user account, a service account allows your application to authenticate and communicate to Google APIs without direct human intervention. This is useful for applications that need to access their own data, not the user's data. For a successful service account authentication, you need:
*Private key file: A .json or .p12 file that contains the key required to authenticate API calls. You can download it from the Google Cloud Platform (GCP) Console.
*Service account's email address: A unique email address that is provisioned while creating a service account.
To know more about service account authentication, refer to the Google documentation.
To configure the driver to use service account authentication, set the following connection properties:
*Set the AuthenticationMethod property to serviceaccount.
*Set the ServiceAccountEmail property to specify your service account's email address.
*Set the ServiceAccountPrivateKey property to specify the full path to the .json or .p12 private key file.
Note: If you are using a .p12 private key file, you must set the skipDDPKIProvider system property to true.
The following example shows how to connect to a Google BigQuery instance using service account authentication.
Connection conn = DriverManager.getConnection
("jdbc:datadirect:googlebigquery:AuthenticationMethod=serviceaccount;
Project=myproject;Dataset=mydataset;ServiceAccountEmail=abc123@iam.gserviceaccount.com;
ServiceAccountPrivateKey=abc123.json;);