Skip to content

How to use with external browser authentication #226

@ryunik

Description

@ryunik

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 Web3Auth/Auth#141. Not sure in which repo this belongs

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions