Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

GCP - GoogleCredential vs GoogleCredentials

I'm creating GPC clients for BigQuery & Transfer API, using GCP Java API. To each client I need to initiate different type of credentials -

GoogleCredential javadoc - for Transfer API

GoogleCredentials javadoc - for BigQuery

Is there a convenient way to convert between the two so I won't need to manage reading two types of credentials?

Also - could anyone reason why there was a need for these two types?

like image 618
Vitali Melamud Avatar asked Jan 23 '18 13:01

Vitali Melamud


1 Answers

You can use a HttpCredentialsAdapter to use the more recent GoogleCredentials with the Google API Client Libraries for Java.

I don't know of a way to do the reverse transformation, i.e., generate a GoogleCredential from GoogleCredentials.

like image 114
João André Martins Avatar answered Oct 06 '22 02:10

João André Martins