I've an android app available on google play with around 5k daily users.
I'm having a weird error related to firebase auth, it is something not common so please read carefully before jumping into conclusions:
I use Android_ID as user identifier for the users of my app Settings.Secure.getString(getContentResolver(), Settings.Secure.ANDROID_ID)
I do know it is not the best idea, but it fits my requirements because it is unique, everyphone has one and it is impossible to change (i supose). So i use it to authenticate my users in firebase this way i can write firebase rules that block users from seeing data of other users based on their ANDROID_ID
BUT SOME USERS ARE GETTING ACCESS DENIED WHEN TRYING TO READ THEIR OWN DATA...
That looks super weird and the first idea is that there is a bug in my code, but after debugging a lot i couldn't find any error so i started loging the requests
and my logs showed something like this
D/CrashlyticsCore check firebase access denied: device_id: e4c511c3-8ed7-3430-b3b0-e16d56acd2ad auth: da190696-e4bc-32f9-b229-eb24631a39fc
this message is saying that the user was authenticated with: da190696...
but know its id value is: e4c511c3...
I also noticed that the deny of access usually happens after app was minimized
so the question is: are there any explanation for this? is it possible to user change the device_id on an unrooted device? is it possible somehow it is been randomized by android?