1

To Authenticate pipeline in Python project I'm using this

os.environ["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/the/json/key.json"

How to do the same thing BUT with the loaded JSON file? (without using path to the JSON)??

2
  • 1
    The environment variable is processed by the SDKs. There are no environment variable method to use the JSON body instead of the file name. You will need to use one of the library from_service_account_info() methods to load raw JSON. Commented Jul 27, 2021 at 19:32
  • @JohnHanley I have just checked the link in the provided solution and found exactly what you have mentioned.... have not tried it yet... but looks like this should solve the problem Commented Jul 27, 2021 at 19:33

1 Answer 1

3

There are a few ways to authenticate against a project in Google Cloud. Please take a look at: https://googleapis.dev/python/google-api-core/latest/auth.html as well as the best practices as mentioned here: https://cloud.google.com/docs/authentication/best-practices-applications

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.