Skip to content

Commit

Permalink
PR comments
Browse files Browse the repository at this point in the history
  • Loading branch information
fahadshamiinsta committed Jun 28, 2023
1 parent 95cc347 commit 2845c07
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -215,11 +215,12 @@ StorageOptions createStorageOptions(
storageOptionsBuilder.setProjectId(clientSettings.getProjectId());
}
if (clientSettings.getCredential() == null) {
logger.info("\"Application Default Credentials\" will be in use");
try {
final GoogleCredentials credentials = SocketAccess.doPrivilegedIOException(() -> GoogleCredentials.getApplicationDefault());
storageOptionsBuilder.setCredentials(credentials);
} catch(IOException e) {
logger.error("Error while getting \"Application Default Credentials\"", e);
logger.error("Failed to retrieve \"Application Default Credentials\"", e);
}
} else {
ServiceAccountCredentials serviceAccountCredentials = clientSettings.getCredential();
Expand Down

0 comments on commit 2845c07

Please sign in to comment.