Hi,
This topic is similar to:
However, the information in that topic seems to no longer apply, or at least the successes there are only half-documented and I cannot replicate their success.
I am trying to authenticate within a Chrome Extension, and I see two possible methods:
- Authenticate on the Extension Options page
- Authenticate on the Extension Popup
I have tried option 1, however the loginWithPopup()
method fails at creating a new popup window, instead a new tab is opened with the internal address of about:blank#blocked
.
(See similar GitHub issue: PWA loginWithPopup blocked · Issue #300 · auth0/auth0-spa-js · GitHub)
loginWithRedirect()
is not an option here as the Extension Options is within a Chrome modal window, and this method just causes it to error and loose all of it’s content.
With option 2, the loginWithPopup()
method can actually successfully open a popup window to the login page, but I’m now struggling with the correct redirect and callback URL values to use. I have tried setting them to be the chrome://extensions/?id=extension-id-here
URL, hoping I could catch the token there, but the popup gets stuck on a blank “Authorisation Response” page.
Should I be using some middle-man hosted webpage to redirect to and collect the token?
Has anyone got an actual functioning Auth0 flow within a Chrome Extension?
Appreciate any help.