Supabase auth with OAuth, in Popup instead of Options page?
Is it possible to do supabase auth, with 3rd party oauth provider, in popup page instead of options page?
10 Replies
@nami.w can you clarify what you mean by popup? There's the default popup, and there's a window.create "popup"
Either way, it's possible you just need to configure the callback to send user back to a tab page you control:
Plasmo Docs
Tab Pages – Plasmo
Learn how to use tab pages with Plasmo to create new tab views in your browser extension.
@louisgv thanks for the reponse. By "popup" I mean the small window when you click on the extension's icon in toolbar (default popup.tsx) . I want to know if it's possible to do an oauth redirection without opening any new tabs/pages.
Gave +1 Rep to @louisgv
You can try to potentially open an iframe inside the popup, which do all the SSE auth flow then trickling up an access token. It might be flaky tho because if the user happens to click outside the popup, all state is gone and you will need to reset, OR you can try keeping track of the auth state in storage, then send that as a state arg to the auth flow. It's possible but seems convoluted to me.
@louisgv Thanks for the tip. Apparently it's quite possible for firebase-auth+google-as-provider (https://www.plasmo.com/blog/posts/firebase-chrome-extension).
I want to ask is it possible to achieve similar experiences with say supabase-auth+non-google-provider? If no, is that because chrome extension api does something special for google identity provider?
@nami.w has reached level 1. GG!
Gave +1 Rep to @louisgv
If no, is that because chrome extension api does something special for google identity providerYeah - the oauth API on chrome is designed specifically to integrated with signed in chrome profile, which is linked directly with google identity I think you can try a custom non-firebase setup with just google identity and see if it works/sync similar to firebase
right but I hate to lock users into google identity 😦 Thanks for the insight anyway!