403 when using firebase API to create a project (As an owner user, not a service account) - firebase

I am trying to create a firebase project using the api. The document for this is here: https://firebase.google.com/docs/projects/api/reference/rest/v1beta1/projects/addFirebase
I have created a GCP project already and I am the owner of this project. I can see my project in a request to:
https://firebase.google.com/docs/projects/api/reference/rest/v1beta1/availableProjects/list . It has a project id of: projects/my-project-id-here
I am making the requests as a owner of the GCP project user account (I am not using a service account!) using Google OAuth 2.0 with the correct scopes (You can try it in the documentation), but I am receiving a response of:
{
"error": {
"code": 403,
"message": "The caller does not have permission",
"status": "PERMISSION_DENIED"
}
}
I can create firebase project fine If I go to firebase website directly and create the project there.
Google take 30 days to delete my test projects, so I am restricted to how many times I can try to get this right from scratch. Therefore I am also interested to know how you fully unlink firebase from a GCP project without deleting that project. Removing the service account and disabling the APIs from GCP console doesn't seem to do the trick.
Finally, I do not know if it is relevant but I also have the same user account setup with a developer account on google play and the GCP project is linked up for API access it's created service account granted access. I don't think this is relevant though, as my understanding is that I can setup a firebase project without this.
Hope someone can help!

I've found the solution to this. You cannot use the firebase API to create a firebase project unless you've first accepted the terms and conditions which aren't shown to you until you're in a firebase project (go figure).
Anyway here are some clear steps:
Create a firebase project through the website
Open the firebase project
Accept the terms and conditions for firebase use
Delete the firebase project and enjoy the API now working.

Regarding your interest in removing firebase from a project, this is not supported. The best course of action is to undo the changes that were made when firebase was added, namely disabling the firebase APIs, removing oauth client/brand, removing API keys etc, which you have already done, and it’s the closest thing to deleting the project.

Related

Can you give blanket public access to users in a Firebase project?

I have an open-source project that uses two separate Firebase projects for a test environment and the production one.
Ultimately, I want to have other developers be able to pull down the project and actually be able to run it WITHOUT me needing to give each individual developer access.
I see a number of solutions in this question: How to add collaborators to a Firebase app?. Those all seem to require each person's email.
I understand why it maybe isn't a thing, but I am wondering if there is a way to just give access to everyone for only the test project so that contributing is super low-friction. Something similar to Firestore database rules that allow read/write in a public fashion to get started for testing.
I've tried making a new IAM account in the Google Cloud Console, and I think that partially worked for the Firebase Cloud Functions access to Admin SDK, but my collaborators get hung up trying to run firebase use <test-firebase-project> saying that they don't have access.
I see a lot of other config options for IAM, but nothing sticking out to me for this public access scenario.
Can anyone confirm this either is or isn't a thing?
Thanks!
EDIT
To add some more detail to my project...
I am using Authentication, Firestore, and Cloud Functions. The only js package I will use is the Auth one, which will be loaded from a CDN (so I believe that doesn't apply to my question).
I want to give access to people to run the Cloud Functions locally. There is a pre-build step that I have made in vanilla Node that calls a Cloud Function (running locally), which uses the Firebase Admin SDK to call my Firestore database. I then write that response to a JSON file that my front end uses.
When my collaborators pull down the project, and install the Firebase CLI, when they try to serve the Cloud Functions locally, they get hit with a "no access" type of error. I was trying to resolve this by adding a service account into the /functions directory, but apparently that didn't help.
My collaborators don't need access to the console at all. I basically just need them to be able to run the Cloud Function locally (and make sure they can't access my production Firebase project).
I am happy to add more detail, but I kind of feel like I am just rambling. Thanks again.
There is no way to grant everyone contributor access to your Firebase console. You will either have add each individual user, or create your own dashboard that uses the API to show the relevant data.

The custom token corresponds to a different audience

I'm using firebase for authentication on my app, while developing I created a firebase project which I was using for that purpose, but now I've to sync it with another app. So on updating my google-services.json I'm getting the below error and am not able to connect to firebase.
The custom token corresponds to a different audience. [App ID does not match requested prject.]
How can I migrate my project to another one??
Try clearing the app data, it may be loading something from storage which is related to the other project.
I finally got the app working, basically firebase does not allow two projects with similar configuration. So in my case the test project I created while development had SHA key of my app configured, becasue of which I was getting the error.
I deleted that key and the conflict got resolved.
This is mainly in cases when you're using modules like Authentication where SHA key is used to identify the app.

Change Firebase Cloud Message account

I have my android app running firebase cloud message using uat#gmail.com. and now, i need to change the administration to production account bbb#mycompany.com
what i have done, using bbb#mycompany.com to create new project and generate a new google-services.json and replace existing google-services.json i created with aaa#gmail.com
using android studio connect to firebase and show
Firebase: A config file "D:\xxx\xxx\google-services.json" was found, but it indicates a project ID "xxx-1vv" that you dont appear to have access to. Request access or delete the file in order to proceed with the connection process.
anyone could help??
You can transfer ownership of a Cloud (Firebase) product without having to change the way your users user the project. Please read this for details. Note that all Firebase projects are also Cloud projects, so anything you do in the Cloud console applies to Firebase.

Firebase init error: Unable to authorize access to project [PROJECT ID]

I'm trying to initialize firebase functions for an iPhone app.
I have two separate accounts that I have different firebase projects on.
I ran firebase init, but I get an error
Error: Unable to authorize access to project[PROJECT ID]
where the project ID is a project id for a project in the account im not using.
I used
Firebase use --add
and it worked perfectly.
I ran
Firebase list
and the project I want to init is listed there. But when I ran the init again I got the same error with the wrong project ID still.
ps. the other project ID doesn't come up in Firebase list
EDIT: I logged out of the different account and am logged into the correct account.
You should check the alias. Aren't you just setting your project for staging?
After Firebase use --add, you should do like
What alias do you want to use for this project? (e.g. staging) default
and also
What alias do you want to use for this project? (e.g. staging) dev
In other words, you have to switch all the alias to the project you re trying to use.
This worked for me!
Firebase login to the account that has the project.
If you're switching between two Google accounts, you have to firebase logout from one and firebase login to the other before you can access the projects in those different accounts.

Where can i find the link to my newly created app in firebase?

Im trying to locate the link that is supposed to be created along with my app on Firebase(according to the udacity Firebase course).
I found many links but none of them were accepted by the "after lesson quiz" on udacity.
The content that they have is according to the old UI of Firebase so i cant follow it step by step.
Unfortunately that course is for Firebase 2.x (www.firebase.com) and is out of date. In the legacy Firebase docs, under step 5 : Read & Write to your Firebase Database, you can see that creating a Firebase reference required the actual web address for you app. This is no longer true.
The new and correct way to setup your Firebase app does not require you to use this web address. The steps for setting up a Firebase app now are HERE.

Resources