GeezerVison is showing github.com — Adding a createFromFile method to AuthCredentials · Issue #179 · googleapis/google-cloud-java
Adding a createFromFile method to AuthCredentials #179DescriptionWe now have a createFor(String account, PrivateKey privateKey) to create AuthCredentials, what about adding a createFor(File) for creating AuthCredentials from a service account JSON file?
Notably GoogleCredential already has fromStream that reads credentials from a stream of the JSON file. If you prefer, we can go for createFor(Stream) rather than createFor(File). Activityaozarov commented on Sep 24, 2015 I would definitely prefer createFor(stream) rather than createFor(File) as the latter is not supported in some systems (such as AE).
Do you think this issue is a dup of #3?
In any case, I think if we add it it should only support a json content (so maybe method name should state it).
The reasons I don't think we should support p12 in this method are:
- User can change their password (so we need to ask for that).
- I am not sure we can extract the service_acount from it.
- Seems to be deprecated.
mziccard commented on Sep 24, 2015 ContributorAuthor More actions Ooops sorry I missed #3. Yes this is a duplicate :(
I prefer createFor(stream) as well as it supports more uses. And I also agree that we can live without P12:
- AFAIK it does not contain service_account information
- It is supported just for backward compatibility with code that already used P12
GoogleCredential.createFor also supports only JSON format and states it in the javadoc. If you want to be more precise we can name it createForJson() but it kind of breaks the naming convention.
aozarov commented on Sep 24, 2015 We already have createForComputeEngine and createForAppngine.
I am fine with createFor(Stream jsonStream) or createForJson(Stream) and a good javadoc
that is pointing to the public docs (such as this one). mziccard commented on Sep 25, 2015 ContributorAuthor More actions
MetadataMetadataDevelopmentNo branches or pull requestsIssue actions
|