Setup
In your Lark project settings, set the Firebase Auth Project ID to your Firebase project ID. You can find this in the Firebase console under Project Settings. This tells Lark how to validate the Firebase Auth tokens your clients send.How it works
- Your client authenticates with Firebase Auth as usual.
- The Firebase SDK sends the user’s ID token when connecting to the database.
- Lark validates the token’s signature using Firebase’s public keys.
- Once validated, the
authobject in your security rules contains the user’suidand claims from the Firebase token.
Lark validates Firebase Auth tokens automatically using Firebase’s public keys. Once validated, the user’s identity is available in your security rules just like it would be in Firebase.
Security rules
Once a Firebase Auth token is validated, theauth variable in your security rules works exactly as it does in Firebase:
auth.token. For example, if you set an admin claim, you can check auth.token.admin === true in your rules.

