securetoken keys, then checks the project, issuer, expiry, and your restrictions. It’s the same ID token your app already sends to Google Cloud services, so you don’t need a second sign-in.
To open it, navigate to App Services → Authentication Providers in the Backend Console and add a Firebase provider.
How requests work
Your app gets the ID token from the Firebase SDK and sends it on every request to your Archie backend.
Archie reads the ID token only from the
Authorization header, with the Bearer scheme.
If the request has no Authorization header at all, Archie answers 401 with the message Missing required headers: x-project-id and/or authorization. That response has no extensions.code, because no token reached the provider.
Always ask the Firebase SDK for the token right before the request. ID tokens expire after one hour, and
getIdToken() returns a fresh one when the current token is about to expire.Before you start
Collect these values from Google.Firebase Project ID
- Open the Firebase console and select your project.
- Click the gear icon, then Project settings.
- Copy the Project ID from the General tab.
my-app-1a2b3.
Identity Platform Tenant ID (only for multi-tenancy)
Skip this if you don’t use Identity Platform tenants.- Open the Google Cloud console and select the same project.
- Navigate to Identity Platform → Tenants.
- Copy the Tenant ID of the tenant your users sign in to.
Issuer
You don’t enter the issuer. Archie derives it from the Project ID and shows it read-only:Configure the provider
The form has four sections. Click Save when you’re done.General
Restrictions
Revocation
By default, Archie accepts a valid token until it expires, even if you revoke the user’s sessions or disable the account in Firebase. Turn on revocation checks to close that gap.
The key must be a JSON key of type
service_account that belongs to the same project as the Firebase Project ID. After you save, the console shows the key masked. To keep the stored key when you edit the provider, leave the field empty.
Check Revoked Tokens can’t be combined with Additional Project IDs. The service account can only check revocation in the main project, so a configuration with both is rejected when you save. If you need revocation checks, accept tokens from a single Firebase project.
See Set up the service account for revocation.
Advanced
Claim fields take a simple, top-level claim name such as
sub or roles: letters, digits, and underscores, up to 64 characters. Nested paths such as app.roles aren’t supported.
The Roles Claim is off by default. Leave it off unless your backend controls the custom claims. Turning it on isn’t enough to grant roles: list the roles you want to accept in Allowed Roles. Roles still come from Role-Based Access.
uploadCsv) is refused with 403 and the code CLAIMED_ROLES_OPERATION_UNSUPPORTED. Run imports with a credential whose roles are assigned in Archie.
Archie checks Allowed Roles when you save the provider, and checks every role again on each request. A role that has since become administrative or privileged, been deactivated, or been deleted is no longer granted, even if it is still in Allowed Roles. If Archie can’t check the roles at that moment, the request is refused with 503 and a Retry-After header. It is never let through with unchecked roles.
Test a token before you save
Use Test token to check your configuration without saving it.- Get a fresh ID token from your app, for example by logging the result of
getIdToken()in a development build. - Click Test token and paste the token.
- Read the result. If the token is rejected, compare the result with the error codes.
rate_limited. Wait a minute and try again. rate_limited only comes from Test token; it is never the answer to a request from your app.
What Archie checks when you save
Besides validating each field, Archie runs these checks when you create a Firebase provider or save a change to its configuration (saving an unchanged configuration skips them):- Google’s signing keys. Archie downloads Google’s public
securetokenkeys. If the download fails, the provider is still saved and the console shows a warning. - The service account, with Check Revoked Tokens on. Archie asks Google to read the project’s users with the key. First Archie exchanges the key for an access token. If Google’s token endpoint rejects the key with any
4xxanswer, including429, the save is blocked: for example, the key was revoked or deleted. Any other failure of that exchange, such as a5xxanswer or Google being unreachable, saves the provider with a warning. Then Archie reads the project’s users. If that call answers403, the save is blocked: the service account doesn’t have the Firebase Authentication Viewer role. A429or5xxanswer, or Google being unreachable, saves the provider with a warning. Any other answer that isn’t200blocks the save.
Set up the service account for revocation
Archie needs a service account to ask Google about a user’s status. Give it the least access possible.1
Create the service account
In the Google Cloud console, select the same project as your Firebase Project ID. Navigate to IAM & Admin → Service Accounts and click Create service account. Give it a name such as
archie-token-revocation.2
Grant the minimum role
Grant the role Firebase Authentication Viewer. Archie doesn’t need any other role.
3
Create a JSON key
Open the service account, go to the Keys tab, and click Add key → Create new key. Choose JSON and click Create. Your browser downloads the key file.
4
Paste the key into Archie
Turn on Check Revoked Tokens, paste the full content of the JSON file into Service Account Key, and click Save. Then delete the downloaded file from your computer.
If your organization blocks service account key creation, ask your Google Cloud administrator for an exception for this service account.
Rotate the key without downtime
- Create a new JSON key for the same service account.
- Paste the new key into Service Account Key and click Save.
- Check that requests still succeed.
- Delete the old key in the Google Cloud console.
How long changes take
Archie caches some results to keep requests fast. These are the windows to plan for.When you disable or edit the provider, Archie clears the cached results of that project. If that notification is lost, the cached results expire on their own within about 90 seconds.
Error codes
When Archie rejects a token, it answers HTTP401 with this header and body:
extensions.code to find the cause. The message is always the same.
When Check Revoked Tokens is on and Archie can’t reach Google, the request is refused, never accepted. The answer is
503 with a Retry-After header and the code AUTH_UNAVAILABLE, or 401 in some deployments. Retry after the indicated time.
token_policy_rejected doesn’t say which restriction failed, so attackers can’t probe your policy. To find the cause, review the Restrictions section one field at a time and use Test token after each change.Not supported
- Firebase custom tokens. Exchange them in your app with
signInWithCustomToken()and send the resulting ID token. - Firebase session cookies.
- App Check tokens.
- The Firebase Auth Emulator in deployed environments. Emulator tokens aren’t signed by Google.
FAQ
Can I send a Google Sign-In token directly?
Can I send a Google Sign-In token directly?
No. Google Sign-In ID tokens are issued by Google accounts, not by your Firebase project, so they fail with
token_invalid_issuer. Sign the user in to Firebase with the Google credential, then send the Firebase ID token.Does Archie call Google on every request?
Does Archie call Google on every request?
No. Signatures are checked locally with Google’s public keys. Archie only calls Google for revocation status when Check Revoked Tokens is on, and it caches the answer for up to 5 minutes.
Why are my phone sign-in users rejected?
Why are my phone sign-in users rejected?
In this version, every token must include an email. Phone and anonymous sign-in tokens have none, so they’re rejected with
token_policy_rejected.Why are my Identity Platform users rejected with token_invalid_tenant?
Why are my Identity Platform users rejected with token_invalid_tenant?
Their tokens carry an Identity Platform tenant. If the provider has no Tenant ID, every token with a tenant is rejected; if it has one, only tokens from that tenant are accepted. Set Tenant ID to the tenant your users sign in to.
Can I accept tokens from more than one Firebase project?
Can I accept tokens from more than one Firebase project?
Yes. Add up to 10 other projects to Additional Project IDs. This can’t be combined with Check Revoked Tokens: revocation is only checked in the main project, so a configuration with both is rejected.
Do I configure the provider in every environment?
Do I configure the provider in every environment?
Yes. Authentication providers are scoped per environment and their secrets are never copied when you branch an environment. See Authentication Providers.