Categorygithub.com/CC-04-24H2/firebase-admin-auth
modulepackage
0.0.0-20241118025825-a83dc0b3e5d9
Repository: https://github.com/cc-04-24h2/firebase-admin-auth.git
Documentation: pkg.go.dev

# README

Firebase Admin Auth

Description

This repo contains a simple auth service using Firebase Admin SDK.

App feature:

  • Verify ID token

This simple app is an admin app for firebase-auth project. The goals of this project is to explain the flow to use Firebase Auth on a custom backend service.

This project written in Go.

How to Run

  1. Create or use existing Firebase project
  2. Go to Project settings > Service accounts
  3. On Firebase Admin SDK choose Generate new private key
  4. Place the private key downloaded on config directory of this project
  5. Create .env on the root of this project by copy-paste .env.example provided (more on Environment Variables section)
  6. Install dependencies
    go mod download
    go mod tidy
    
  7. Run the project
    go run main.go
    

Environment Variables

  • GOOGLE_APPLICATION_CREDENTIALS: relative/absolute path to the service account JSON file (e.g. config/service-account.json)
  • ID_TOKEN: ID token to be verify, obtained from user object on client

References