I can't not set a bucket with google storage with my firebase session.
I have a access credentials to Firebase and I'm using the google storage libraries to upload the documents, when I try to make the connection to create the bucket through this code:
ctx := context.Background( )
projectID := "xxxxx-xxxx-xxxx"
client, err := storage.NewClient(ctx )
if err != nil {
log.Fatalf("Failed to create client: %v", err)
}
It generates the following error =>
But I entered at first and generated my credentials to use Firebase, when I did I generated a json file with the tokens
The error tells you the solution.
Go to: https://developers.google.com/accounts/docs/application-default-credentials
You must create another JSON file with the GCP KEYs, so you can make transactions with the google storage, this is another file, with tokens that are not equal to the firebase, additional must have an associated account for billing, otherwise it will generate errors..
After you have that json file, you put it in this way in the code:
`ctx := context.Background( )
projectID := "xxxxx-xxxx-xxxx"
client, err := storage.NewClient(ctx, option.WithCredentialsFile("path/path/tokensGoogleStorage.json"))
if err != nil {
log.Fatalf("Failed to create client: %v", err)
}`
With this, you must successfully create the Bucket to work with cloud.google features!!!