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
Is it possible to make ServiceAccountCredentials.fromJson() a public method so that it is accessible outside the package?
At the moment, I am using ServiceAccountCredentials.fromPkcs8(). However, using ServiceAccountCredentials.fromJson() might simplify some code at my end (which fromJson method also have before it calls fromPkcs8).
The text was updated successfully, but these errors were encountered:
In general, we prefer developers interact with the GoogleCredentials class unless you know for sure you are providing ServiceAccountCredentials. If you have a JSON file, you can use GoogleCredentials.fromStream(InputStream) which can handle more than just ServiceAccountCredentials without failing.
If this is not good enough for your needs, can you add more details about your use case and need to create the ServiceAccountCredentials from a Map<String, Object>?
My use case is, my client application receives the content of JSON file from another test account service. So my client application uses that JSON content to fetch ServiceAccountCredentials.
So currently I am using ServiceAccountCredentials.fromPkcs8() to fetch the ServiceAccountCredentials
Supporting the Map<String, Object> interface would make it easier to fetch credentials when the key info has already been parsed. For instance, if the key info was being stored in a database instead of as a json file on disk.
I am using this library from Clojure, where it is idiomatic to parse json into data and manipulate that rather than treating json as a stream of bytes.
If one has already parsed the json, the current options are to use ServiceAccountCredentials.fromPkcs8() which is tedious, or to serialize the map of data into json just so GoogleCredentials.fromStream(InputStream) can parse it again.
Is it possible to make ServiceAccountCredentials.fromJson() a public method so that it is accessible outside the package?
At the moment, I am using ServiceAccountCredentials.fromPkcs8(). However, using ServiceAccountCredentials.fromJson() might simplify some code at my end (which fromJson method also have before it calls fromPkcs8).
The text was updated successfully, but these errors were encountered: