I develop a kind of casino application, and users can win real cash on it. To avoid fraud we need to check that user only use one device at the same time.
When I look to Android doc about how to identify device : https://developer.android.com/training/articles/user-data-ids#best-practices-android-identifier:
Use a Firebase installation ID (FID) or a privately stored GUID whenever possible for all other use cases, except for payment fraud prevention and telephony. For the vast majority of non-ads use cases, an FID or GUID should be sufficient.
So doc says :
- to use FID or GUID except for payment fraud (which is my case)
- to avoid using hardware identifiers such as IMEI or DEVICE_ID
So what're best practices for fraud ?
When user opens the application and logs in, you should send a request to the server containing user's ID, assign that user a session ID and store the mapping {userId: sessionId} in a key-value store for the period when user remains online.
Now whenever a user opens your application and logs in (or is already logged in), check if that user's Id already exists in key-value store, if it does, then don't allow that session, otherwise log that user in, when user leaves your application, remove that mapping from the key-value store.