Writing Firebase database rules when user information are on another server -
i need implement chatting mobile app talks own server, registered user information on own server. so, if use firebase real-time database chatting, how write security rules these:
".read": "auth != null", ".write": "auth != null"
so scenario is, user's information on own server, in own database. want use firebase implement chat
how write database rules prevents reading messages database (by hitting url maybe ?)
yours precisely scenario firebase custom authentication made for.
on server authenticate user against own user database, mint json web token information user want firebase know. @ least token should contain uid
, may contain more information can access in security rules. once you've created jwt, return user.
in app, use jwt sign in firebase. example on android means, you'll call firebaseauth.signinwithcustomtoken()
method.
for more information see firebase database server documentation.
Comments
Post a Comment