Incorporating Keyri QR login into your Firebase-based authentication system involves sending the user's uid, emailVerified, isAnonymous, providerData, and stsTokenManager strings/booleans/objects from your mobile app to your web app via the Keyri mobile SDK and web Widget. On the mobile side, just load these items (as an object) as the payload into the Keyri method you're using in your app. On the web side, extract these items from the payload that the Widget outputs and set them into the IndexedDB. The following example code walks through how to do this with a vanilla Webpack-based web app and a Flutter mobile app.
- You must first have a Keyri account with a service registered under the domain name on which you will be showing the login QR code
- Your user must already be registered in your Firebase auth system
- Your user must already be logged in on your mobile app (the five items listed above must be available and valid for a logged-in session)
Source code for an example web app can be found here: https://github.com/Keyri-Co/keyri-firebase-example-web. The live demo is here: https://example-keyri-auth.web.app/
Example HTML web page below. First, simply add the Keyri Widget iFrame
This Flutter example shows how to extract the user's uid, emailVerified, isAnonymous, providerData, and stsTokenManager strings/booleans/objects provided by Firebase in your app and send it to the web Widget via the Keyri SDK