Web3Auth / web3auth-web

Simple infrastructure that enables Web3 wallets and applications to provide seamless user logins for both mainstream and Web3.0 users.
https://web3auth.io/docs
Other
424 stars 229 forks source link

How to use with external browser authentication #226

Open ryunik opened 2 years ago

ryunik commented 2 years ago

Trying to integrate into an electron application where the user selects their authentication option in the electron app, but when they select a social login (eg. Google), they are taken to the default browser on their computer, rather than redirecting in the same electron window or a electron hosted popup window.

I'm able to intercept the requests using the uxMode popup or redirect, and open the same link in the user's default browser, but upon opening, it's just a blank screen, with the following error message in console:

image

This happens when trying to open either of the links in an external browser:

Looking through the code a bit, seems the popup option probably will not work, since it relies on window.postMessage to communicate with the original window. Whereas the redirect option seems to go off the hash params passed to the redirect link? If I could get the initial auth to complete successfully and set a custom redirect link, it should be relatively easy to send the hash params back to the electron app, but not sure if there is a method to init manually with this value, or if it's only ever extracted from the window href?

Any help would be greatly appreciated! 😁

Cross post of https://github.com/torusresearch/OpenLoginSdk/issues/141. Not sure in which repo this belongs

AndonMitev commented 1 year ago

Hey bro, how do you manage to open user browser, when i click on social login nothing happens? :(