Title: FirestoreOptions .setCredentials() seems to be ignored · Issue #3458 · googleapis/google-cloud-java · GitHub
Open Graph Title: FirestoreOptions .setCredentials() seems to be ignored · Issue #3458 · googleapis/google-cloud-java
X Title: FirestoreOptions .setCredentials() seems to be ignored · Issue #3458 · googleapis/google-cloud-java
Description: I recently upgraded Firestore from version 0.51.0-beta to 0.52.0-beta, which allows overriding of various options. My instantiation broke and now throws this exception: com.google.cloud.firestore.FirestoreException: java.io.IOException: ...
Open Graph Description: I recently upgraded Firestore from version 0.51.0-beta to 0.52.0-beta, which allows overriding of various options. My instantiation broke and now throws this exception: com.google.cloud.firestore.F...
X Description: I recently upgraded Firestore from version 0.51.0-beta to 0.52.0-beta, which allows overriding of various options. My instantiation broke and now throws this exception: com.google.cloud.firestore.F...
Opengraph URL: https://github.com/googleapis/google-cloud-java/issues/3458
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"FirestoreOptions .setCredentials() seems to be ignored","articleBody":"I recently upgraded Firestore from version 0.51.0-beta to 0.52.0-beta, which allows overriding of various options. My instantiation broke and now throws this exception:\r\n`\r\ncom.google.cloud.firestore.FirestoreException: java.io.IOException: The Application Default Credentials are not available. They are available if running in Google Compute Engine. Otherwise, the environment variable GOOGLE_APPLICATION_CREDENTIALS must be defined pointing to a file defining the credentials. See https://developers.google.com/accounts/docs/application-default-credentials for more information.\r\n`\r\n\r\n My previous service instantiation code looked like this:\r\n```java\r\nGoogleCredentials creds = getServiceAccountCredentialsFromFile();\r\nFirestore firestore = new DefaultFirestoreFactory()\r\n .create(\r\n FirestoreOptions.newBuilder()\r\n .setCredentials(creds)\r\n .setProjectId(projectId)\r\n .build());\r\n```\r\n\r\nAfter upgrading this config no longer works; I have to do something like this:\r\n```java\r\nFirestore firestore = new DefaultFirestoreFactory()\r\n .create(\r\n FirestoreOptions.newBuilder()\r\n .setCredentialsProvider(FixedCredentialsProvider.create(creds))\r\n .setProjectId(projectId)\r\n .build());\r\n```\r\n\r\nI have also tried this:\r\n```java\r\nFirestore firestore = new DefaultFirestoreFactory()\r\n .create(\r\n FirestoreOptions.newBuilder()\r\n .setCredentials(creds)\r\n .setProjectId(config.getString(\"firestore.projectId\"))\r\n .setCredentialsProvider(FirestoreOptions.getDefaultCredentialsProviderBuilder().build())\r\n .build());\r\n```\r\n\r\nbut this also did not work.\r\n\r\nIs it expected that `setCredentials()` is effectively ignored?","author":{"url":"https://github.com/andrewparmet","@type":"Person","name":"andrewparmet"},"datePublished":"2018-07-12T15:33:23.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":3},"url":"https://github.com/3458/google-cloud-java/issues/3458"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:a57f3588-7bb9-d2a2-31d2-8e5798250d79 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 8B8C:131F84:25DD16B:3599BE4:6A4CE6F8 |
| html-safe-nonce | b94babb5e921a8cd8e34f6f447bc13e8fac778bfeda25f1f5ef91d396c2ebf72 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4QjhDOjEzMUY4NDoyNUREMTZCOjM1OTlCRTQ6NkE0Q0U2RjgiLCJ2aXNpdG9yX2lkIjoiMjQ4NDA4MTEzNDQxOTEwOTYyNCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | ed596e08db28df612233aa5cf86406846e737f2070cdfbc6bdbc27a31063de67 |
| hovercard-subject-tag | issue:340690288 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/googleapis/google-cloud-java/3458/issue_layout |
| twitter:image | https://opengraph.githubassets.com/3427c7ab90265f7834ca62618497db791232f9e9698a0e3f1cf253a92a27f51b/googleapis/google-cloud-java/issues/3458 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/3427c7ab90265f7834ca62618497db791232f9e9698a0e3f1cf253a92a27f51b/googleapis/google-cloud-java/issues/3458 |
| og:image:alt | I recently upgraded Firestore from version 0.51.0-beta to 0.52.0-beta, which allows overriding of various options. My instantiation broke and now throws this exception: com.google.cloud.firestore.F... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | andrewparmet |
| hostname | github.com |
| expected-hostname | github.com |
| None | 299b43bca6e02ad35197ffeba30d2466846d5fb02ab96fbced5b5e6cec589fb8 |
| turbo-cache-control | no-preview |
| go-import | github.com/googleapis/google-cloud-java git https://github.com/googleapis/google-cloud-java.git |
| octolytics-dimension-user_id | 16785467 |
| octolytics-dimension-user_login | googleapis |
| octolytics-dimension-repository_id | 26181278 |
| octolytics-dimension-repository_nwo | googleapis/google-cloud-java |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 26181278 |
| octolytics-dimension-repository_network_root_nwo | googleapis/google-cloud-java |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | c5a57f04eeb310f57c73fd6d751d957e2ca27ed2 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width