🛠️Set up your own auth URL
Step 1: Creating Firebase Project
Create your own Firebase Project on: https://console.firebase.google.com/

Step 2: Setting up Authentication
Add "Authentication" to your Project:

Add "Anonymous" (to retrieve pairing code) and at least one other sign-in method. We suggest "Email/Password" and "Google" sign in (as they don't need any extra step):


Step 3: Setting up Realtime Database
Add "Realtime Database" to your Project:

Select Database Location and any security rule (we will change this in next step):


Now switch to the "Rules" tab, paste the code below and click "Publish" (these rules ensure that users can only read/write their own data):
{
"rules": {
"users": {
"$user_id": {
".write": "auth.uid == $user_id",
".read": "auth.uid == $user_id"
}
},
"tokens": {
".write": "auth.token.email != null",
"$code": {
".write": "auth.uid.toLowerCase().beginsWith($code)",
".read": "auth.uid.toLowerCase().beginsWith($code)",
}
}
}
}

Step 4: Host your Auth Page
Add "Hosting" to your Project:

Following the steps below to set up Firebase Hosting:



Afterwards copy the "index.html" which is delivered with the AuthPair Unity package (in Web folder) to the currently created "public" folder:

... and run firebase deploy
in your command line to deploy the new index file.
Then you should find your own auth page on https://[YOUR_PROJECT_ID].web.app


Step 5: Link to your new Firebase Project
Finally open the AuthPair Demo scene in Unity or add the AuthPair prefab to your scene as described in Get Started
Then copy the "Realtime Database" path and the "API Key" (from Firebase Project Settings) into the Firebase Auth Script (Settings in AuthPair prefab) as shown on the Screenshot below:



And change the URL of the "AuthInstruction" text to your own auth page: https://[YOUR_PROJECT_ID].web.app

The Result
Now run your Unity scene, klick "Sign In", enter the shown pairing code on your newly created auth page and click "Connect Device".
You'll see that your Unity scene automatically logs in and the moving game objects are updating your Firebase Realtime Database every second:

If you stop and run the scene again, the objects and score will continue with the previous position and score since those values were saved in the database.
Device Independent Storage
Because the object data (position, rotation, scale) and the text value is stored in the user account and not on the device, you now have a Device Independent Storage.
That means, even if you run the app/game on another device you still have the same data 🎉
Last updated