Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Storing client's IP address in Firebase

Tags:

As far I know there is no information available from the browser to find out the client's IP address without making another call to another resource.

Is there a way to store a client's IP address? I mean in a similar way as the firebase.timestamp placeholder works.

like image 785
webduvet Avatar asked Jun 27 '14 12:06

webduvet


1 Answers

Although I've heard that there are now ways for clients to determine and report their IP address, relying on client side code to report their IP address also opens up the ability for anyone to run custom client side code to report the wrong IP address.

The only secure way of keeping track of the clients' IP addresses would either involve you having a server, or Firebase having a special function, when called by the client, that causes firebase's server to grab the client's IP address and save it for you.

My recommendation would be to run a simple server that can take a POST request. The server only needs to be able to verify what user the request is coming from, and will be able to accurately grab the client's IP address and save it on firebase.

like image 61
IlIIlllIIIlIIlllIlIllIIIlIlI Avatar answered Sep 19 '22 17:09

IlIIlllIIIlIIlllIlIllIIIlIlI