Luiz E.
Luiz E.

Reputation: 7239

server authentication without credentials file

I have an app with server authentication, exactly as follow

// Initialize the app with a service account, granting admin privileges
FirebaseOptions options = new FirebaseOptions.Builder()
    .setDatabaseUrl("https://databaseName.firebaseio.com")
    .setServiceAccount(new FileInputStream("path/to/serviceAccountCredentials.json"))
    .build();
FirebaseApp.initializeApp(options);

turns out that the serviceAccountCredentials.json is in the gitignore, but I need to have this file in the server while building/deploying the app...
is there a way to do server auth without this file?

Upvotes: 0

Views: 263

Answers (1)

Frank van Puffelen
Frank van Puffelen

Reputation: 598750

firebaser here

Update (2016-08-16) from the linked Google Group post:

We just released version 3.3.0 of the Firebase JavaScript SDK... our Node.js SDK now supports the client-side auth and user management methods found in the web version of the SDK! That means you can authenticate your Node.js process using end-user credentials as well as manage user accounts.

Read the post for full details.

Previous (accepted) answer

Currently the only way to authenticate from a node.js server is by using the service account. We're working on expanding this.

See this post on our firebase-talk group.

Upvotes: 1

Related Questions