setCredentials is required but not mentioned in documentation when using setServiceAccountId
See original GitHub issue- Library version: 6.6.0
- Firebase Product: firebase-admin
Following the documentation under “Using a service account ID” I should be able to skip the setCredentials
option in the builder, as based on the documentation it’s assumed to replace the need for a local copy of service-account.json
. However should the setCredentials
be missed, a NullPointerException is thrown
Caused by: java.lang.NullPointerException: FirebaseOptions must be initialized with setCredentials().
Attempt to set FirebaseOptions without a setCredentials
option.
public FirebaseAuth firebaseAuth() throws IOException {
FirebaseOptions options = new FirebaseOptions.Builder()
.setServiceAccountId(SERVICE_ACCOUNT_EMAIL)
.setProjectId(PROJECT_ID)
.setDatabaseUrl(String.format("https://%s.firebaseio.com/", DATABASE_NAME))
.build();
FirebaseApp.initializeApp(options);
return FirebaseAuth.getInstance();
}
Is the documentation incorrect/lacking detail or is this a bug?
Issue Analytics
- State:
- Created 5 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
java - Providing Credentials to Google Cloud Storage API
For some background: I'm trying to compare and contrast Google Cloud Storage and Amazon S3. I can create a program like this in...
Read more >Create Custom Tokens | Firebase Authentication - Google
You can create a custom token with the Firebase Admin SDK, or you can use a third-party JWT library if your server is...
Read more >Class GoogleCredential (2.1.1) | Java client library
Thread-safe Google-specific implementation of the OAuth 2.0 helper for accessing protected resources using an access token, as well as optionally refreshing the ...
Read more >Set up AWS Credentials and Region for Development
This topic provides basic information about setting up your AWS credentials for local application development using the AWS SDK for Java. If you...
Read more >CON12 RADV Intake Process and Guidance to Coders - CMS
It is for internal government use only and must not be ... records for the validation of risk adjustment data, as required by...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
SDK always requires some credentials to authorize remote API calls. Service account ID is only used when signing JWTs using the Cloud IAM API (those API calls also need to be authorized with some credentials).
Thank you very much for clarifying. It gives a lot of confidence to know it won’t mess with all the users hooked up with Firebase (as in, doesn’t play a role in user session management). It would be unfortunate to later discover there were two keys linked to a token and one is gone thereby breaking all token validity.
On Sun, Feb 9, 2020, 9:04 AM Hiranya Jayathilaka notifications@github.com wrote: