问题
I'm goning to use auth.UID
in my backend web service as api_key for each user
I wounder if UID
is final key or it expires/changes
回答1:
The auth.UID
will never expire. One thing to keep in mind is that the auth.UID
will always be the same only if the user does not delete his account. If you let the users the posibility to delete their accounts, if they will sing in again into your app, another UID
will be generated, which will be different from the first one. Not every time the UID is a good solution for identifying a user.
回答2:
I addition to @AlexMamo answer, I found that auth.UID expires when app's data is cleared in scenario when user is signed in anonymously. (note: uninstalling clears app's data too)
Could not comment due to reputation points.
来源:https://stackoverflow.com/questions/45505131/does-firebase-auth-uid-expires-or-not