Loading

Google Big Query Connector: Externalize the private key when using a JWT Connection

Veröffentlichungsdatum: Jul 25, 2025
Lösung

SYMPTOM

You have followed the steps to configure JWT Authentication in the Google BigQuery Connector by referring to the below documentation:
Google BigQuery Connector | JWT Authentication Error - Invalid PKCS8 data
- https://docs.mulesoft.com/google-bigquery-connector/1.0/google-bigquery-connector-studio#jwt

and you intend to externalize the private key. But if you directly add the private key in your mule properties file as key-value pair then you get the below error:
Caused by: org.mule.runtime.api.exception.MuleRuntimeException: Invalid PKCS8 data.
 

CAUSE

The error signifies that the provided private key was not parsed from the properties file correctly by the connector. 

SOLUTION

The solution is to save the private key in a txt file and place it under the src/main/resources folder. Then, refer that txt file in the privateKey field  in the Google Big Query connector configuration as:
${file::private_key.txt}

the equivalent XML of the configuration would look as below:
<bigquery:config name="BigQuery__Configuration"
		doc:name="BigQuery Configuration"
		doc:id="149a1dd1-5349-436d-88c0-12e0dcda1cec">
		<bigquery:jwt-connection
			privateKeyId="${privatekeyid}"
			privateKey="${file::private_key.txt}"
			issuer="${issuer}" appName="${appname}"/>
	</bigquery:config>

Disclaimer: This article involves products and technologies which do not form part of the MuleSoft product set. Technical assistance for such products is limited to this article. This solution provides a suggestion that should be considered in conjunction with your specific use case and requirements and does not represent a complete solution for all circumstances.
Nummer des Knowledge-Artikels

001122175

 
Laden
Salesforce Help | Article