I am building a chrome extension that will be linked with a web app, but I want to have a good UX, so I don't want the user to log in on the extension, then when he presses subscribe, for example, he will be redirected to the web app to log in again, so I am thinking if it is a good solution to redirect him to the web app URL and passing the access token in the URL so that we can check if this token is valid or not by the Firebase Admin SDK maybe by using a Cloud Function
Thank you in advance
You can refer to this Article will explain how you can implement it by using the same principle on iOS or Android or Webapp. The key is to call the callable functions for logged-in users.:
you have a Firebase App that users can log in to. However, before they can use your app, users need to purchase a package that will give them permission. And this product will help to auto-login users from your Firebase App to your WooCommerce / WordPress website. This add-on doesn’t care if users exist in WP or not, it just logs users in with Firebase credentials. That’s it.
As mentioned in the Answer :
you should probably redirect to a page of your web application which, in turns, calls a Callable Cloud Function (passing the
code
andstate
values as arguments).This Cloud Function verifies the token as well as creates a user in Firebase and when this is done, sends back the token to the page of your web application. You then have all the elements to call the
signInWithCustomToken()
method.