We use the Firebase authentication integration and...
# ask-a-descoper
k
We use the Firebase authentication integration and look for the
externalToken
on the session when a user is sent back to us. If we don't get a token, is there a way to tell if it's because something went wrong with the integration or if it's just because the user doesn't exist? If the only time we wouldn't get it is if the user doesn't exist, that makes it easier, but we want to make sure we properly catch any errors in the integration as well. Thanks!
✅ 1
d
Hi, I'm Descope's AI assistant. I've put together an initial response below based on your question. What
externalToken
actually represents
The
externalToken
is generated by the Firebase External Token Connector at the end of a successful Descope Flow. It is a Firebase custom auth token, signed by Descope using your Firebase service account credentials, and returned in the authentication response alongside the Descope session tokens. Does absence always mean the user doesn't exist? No — the absence of
externalToken
does not exclusively mean the user doesn't exist. There are multiple reasons it could be missing: • User does not exist — the flow was not completed successfully, so no token was generated • Connector misconfiguration — the Firebase External Token Connector is not properly set up or the service account JSON is invalid/expired • External Tokens not enabled — External Tokens may not be enabled at the project or flow level in Project Settings • Flow-level override — if you've configured per-flow external token settings, a specific flow may not be wired to the Firebase connector • Connector invocation failure — a transient error during the connector call at the end of the flow could result in a missing token even for a valid, existing user Recommended error handling approach • Don't treat the absence of
externalToken
as a definitive indicator of user non-existence. Instead, implement checks for the various potential causes listed above. • Ensure that your Firebase External Token Connector is correctly configured and that the service account credentials are valid. • Verify that External Tokens are enabled in your project settings and that the flow is correctly set up to use the connector. • Consider logging errors and responses during the flow execution to help diagnose issues when the
externalToken
is missing.
✅ 1