You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to implement a GCS bucket for element storage and the APP_GCS_PRIVATE_KEY variable isn't working. I've tried multiple approaches:
First, I copied my entire private key into this field (removing all \n newlines) and receive an "incorrect padding" error.
Next, I encoded my private key using the script below and pasted my encoded key into APP_GCS_PRIVATE_KEY and receive the error "MalformedError("No key could be detected.")
google.auth.exceptions.MalformedError: No key could be detected."
I'm trying to implement a GCS bucket for element storage and the APP_GCS_PRIVATE_KEY variable isn't working. I've tried multiple approaches:
First, I copied my entire private key into this field (removing all \n newlines) and receive an "incorrect padding" error.
Next, I encoded my private key using the script below and pasted my encoded key into APP_GCS_PRIVATE_KEY and receive the error "MalformedError("No key could be detected.")
google.auth.exceptions.MalformedError: No key could be detected."
import base64
private_key = "-----BEGIN PRIVATE KEY-----[My key] ----END PRIVATE KEY-----"
encoded_key = base64.b64encode(private_key.encode('utf-8')).decode('utf-8')
print(encoded_key)
import base64
import json
with open('service_account_key.json', 'r') as f:
service_account_info = json.load(f)
processed_info = {
"type": service_account_info["type"],
"project_id": service_account_info["project_id"],
"private_key_id": service_account_info["private_key_id"],
# Process the private key:
"private_key": service_account_info["private_key"].replace("\n", "").strip(),
"client_email": service_account_info["client_email"],
"client_id": service_account_info["client_id"],
"auth_uri": service_account_info["auth_uri"],
"token_uri": service_account_info["token_uri"],
"auth_provider_x509_cert_url": service_account_info["auth_provider_x509_cert_url"],
"client_x509_cert_url": service_account_info["client_x509_cert_url"]
}
processed_json_string = json.dumps(processed_info)
encoded_credentials = base64.b64encode(processed_json_string.encode('utf-8')).decode('utf-8')
print(encoded_credentials)
The text was updated successfully, but these errors were encountered: