问题
Assuming my browser script automatically signs any user in anonymously, is it possible to collect the users public IP address? I found the firebase.auth().currentUser.metadata property but it only includes LastSignInTime and creationTime. Is the users public IP address available via the Firebase authentication (or any part of the Firebase JavaScript API) system?
回答1:
Firebase Authentication does not expose IP address as part of the user record, nor is it exposed anywhere in the client side SDKs. You will need a backend to record that for yourself.
来源:https://stackoverflow.com/questions/56926896/firebase-javascript-sdk-retrieve-users-ip-address