Firebase Log-in events

Viewed 21

I want to see Who and When login to the Firebase from UI side, as administrator. It is not related data access from app etc. So, I login to https://firebase.google.com/ as User/Manager/Admin and want to see it in logs. It should be in GCP project related to firebase, if so how can I find it - did saw in Log explorer. Or it should be in Firebase UI? thank you in advance.

1 Answers

I would give you a workaround. You can use Firebase Management API which is in beta.

Consider you have to watch a project.

You can make a request like below to get the Project Details.

GET https://firebase.googleapis.com/v1beta1/projects/{YourProjectID}

Sample Response:

{
  "projectId": "*****************",
  "projectNumber": "*****************",
  "displayName": "Sample App",
  "name": "projects/*****************",
  "resources": {
    "hostingSite": "*****************",
    "realtimeDatabaseInstance": "*****************"
  },
  "state": "ACTIVE",
  "etag": "1_d15ff4d3-727e-431c-8eba-f33957805f23"
}

In the response, you have a key called ETAG. Basically, this changes whenever the project is opened by someone.

You cannot get who is logged-in or other details. You can only know someone has opened, changed or made some operations in the project, using ETAG.

You can simply store the ETAG in your server and poll for the change. If it is changed, then someone might have used the Project.

If you want the Updated Time of the project along with it, you can try this, https://cloud.google.com/resource-manager/reference/rest/v3/projects/get

Related