Closed samlof closed 2 years ago
What you actually want is
authOpt := option.WithTokenSource(
oauth2.StaticTokenSource(
&oauth2.Token{
AccessToken: "owner",
TokenType: "Bearer",
}))
app, err = firebase.NewApp(ctx, conf, authOpt)
This one works with creating users too. WithoutAuthentication()
doesn't work with creating user
Fixed with the above PR. Will be included in the next release.
[REQUIRED] Step 2: Describe your environment
[REQUIRED] Step 3: Describe the problem
Running auth emulator with the wanted env variable FIREBASE_AUTH_EMULATOR_HOST fails.
Steps to reproduce:
Start a project in a clean machine. Add env variable FIREBASE_AUTH_EMULATOR_HOST and make firebase auth app. It gives error
google: could not find default credentials. See https://developers.google.com/accounts/docs/application-default-credentials for more information.
Relevant Code:
The problem was missing the option
firebase.NewApp(ctx, conf, option.WithoutAuthentication())
. This isn't documented anywhere. Took me an hour of searching google and trying all kinds of things.I came across this as Github Action failed to it. Tested on a brand new EC2 ubuntu instance in Amazon and fails too. With
WithoutAuthentication()
option both work as expected.