0

I am trying to run Gofiber firebase-auth. I have generated a private key from Firebase Console, Settings -> Service Account -> Generate new private key and have given the file path to:

.env:

GOOGLE_SERVICE_ACCOUNT = 'C:/Users/Desktop/flutter-demo.json'
WEB_API_KEY = "<API_KEY>"  // from config section of general settings at firebase console
TEST_USER_EMAIL = "test@test.com"
TEST_USER_PASSWORD = "test123"

which is used in main.go:

serviceAccount, fileExi := os.LookupEnv("GOOGLE_SERVICE_ACCOUNT")
opt := option.WithCredentialsFile(serviceAccount)

But, on accessing any of the Authenticated Routes, I'm getting:

Missing or malformed Token

Can anyone please help, maybe I'm doing some mistake or missing something from the docs

Amit Dubey
  • 75
  • 1
  • 8

2 Answers2

0

Hi below is an example of using gofiber firebase auth,

https://github.com/gofiber/recipes/tree/master/firebase-auth

Hope this will help you. Thanks

  • Hi, thank you for the answer. Yeah I have been following the same link. I have mentioned the same in my question too, but it's still not working.. – Amit Dubey Jul 13 '21 at 03:35
0

Thanks to Sachintha, one needs to send an Authorization Header token from login with the user name and password, as go firebase auth just a middleware to check whether endpoints are authenticated and it does not provide any authentication or user login.

Amit Dubey
  • 75
  • 1
  • 8