Is possible to retrieve the logs about when a user is log-in or log-out to the platform? And also send them to stackdriver as Cloud Functions logs? thanks
You can enable Activity Logging for Firebase Authentication using the REST API. Those docs enable logging for the Identity Toolkit API (identitytoolkit.googleapis.com) which is used by both Firebase Authentication and Google Cloud Identity Platform.
One of the easier ways for you to retrieve the auth token for the REST command is to have a project owner use OAuthPlayground and authorize the Identity Toolkit API v3 scopes
After enabling Activity Logging you will be able to view these logged operations in Google Cloud Logging (StackDriver). Now you will be able to see successful and unsuccessful login requests e.g. SignInWithPassword
for email+password auth and SignInWithIdp
for federated sign-in requests like Google SignIn. One way to view requests for a specific user you could filter the logs to only include a specific jsonPayload.response.email
NOTE: Enabling Activity Logging will not enable Google Cloud Identity Platform for the project, so your project will continue to be subject to Firebase Auth Billing and not Google Cloud Identity Platform Billing.
One thing to be aware of is that if you have a large number of users, or really significant activity on your project, you might also want to specify exclusions to minimize cost/traffic/noise.
Is possible to retrieve the logs about when a user is log-in or log-out to the platform?
Unfortunately, Firebase does not provide such informations. To solve this, you should create your own mechanism to keep track of users log-in and log-out.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With