Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Firebase (functions) SDK support #162

Open
xinoxapps opened this issue Jan 11, 2021 · 4 comments
Open

Firebase (functions) SDK support #162

xinoxapps opened this issue Jan 11, 2021 · 4 comments
Labels
kind/enhancement New feature or request

Comments

@xinoxapps
Copy link

Obvious feature request.

Hope to see it as soon as possible.

@kevmoo
Copy link
Collaborator

kevmoo commented Feb 13, 2021

@xinoxapps – do you mean supporting Firebase functions?

@kevmoo kevmoo added the kind/enhancement New feature or request label Feb 13, 2021
@jmewes
Copy link

jmewes commented Feb 13, 2021

I'd understand this issue like this, that all the features of the Firebase API should be accessible from the running Cloud Run container. In particular, I would want to access data from Cloud Firestore or the Realtime Database.

I guess all of this could be done via the firebase package on "pub.dev".

But how would the authentication work from the container towards Firebase? Would the client go through the authentication process like explained in this tutorial and then provide an access token to the Cloud Run container which then passes it through for the authentication towards Firebase?

https://cloud.google.com/run/docs/tutorials/identity-platform

@mrgithub
Copy link

Need firestore and firebase auth examples to be included with this amazing framework so I can get my flutter apps to talk to firestore in a more controlled manner. (use case: flutter web app connects to firebase admin SDK to manage data that users have pushed into the firestore using their mobile apps).

@kevmoo kevmoo changed the title Firebase SDK support Firebase (functions) SDK support Dec 20, 2021
@jpeiffer
Copy link

Here's how I got it to work...

  1. Generate a service-account.json from the GCP IAM console and include it in your build secrets
  2. Attach that file to your Dockerfile that gets generated and uploaded
  3. Using googleapis and googleapis_auth you can create a clientViaServiceAccount
     _client = await clientViaServiceAccount(
        ServiceAccountCredentials.fromJson(
          json.decode(
            File(pathToServiceAccount).readAsStringSync(),
          ),
        ),
        scopes,
      );
  4. Now you can use the FirestoreApi class, or just directly call the Firebase REST URLs, using the now authenticated _client to do what you need.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

5 participants