Firebase JavaScript SDK-检索用户IP地址 [英] Firebase JavaScript SDK - Retrieve Users IP Address

查看:45
本文介绍了Firebase JavaScript SDK-检索用户IP地址的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

假设我的浏览器脚本会自动以匿名方式登录任何用户,是否可以收集用户的公共IP地址?我找到了 firebase.auth().currentUser.metadata 属性,但它仅包含 LastSignInTime creationTime .通过Firebase身份验证(或Firebase JavaScript API的任何部分)系统是否可以使用用户的公共IP地址?

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?

推荐答案

Firebase身份验证不公开IP地址作为用户记录的一部分,也不公开客户端SDK中的任何位置.您将需要一个后端来自己记录下来.

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.

这篇关于Firebase JavaScript SDK-检索用户IP地址的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆