How to have sign-in open different window and get access token back

Viewed 28

I am working on a chrome extension, and when a user creates an account within the extension, I want a separate tab to open up to allow the user to download a Shopify app, and once the app is downloaded that tab should close and the user should be authenticated within the extension. Opening a separate tab for the Shopify app install is trivial, but once that is done, how do I get the access token from the other tab into my chrome extension so that the user is authenticated there? Can I use a webhook for this? How are these types of authentications usually done, where the authentication is done in a separate window?

Basically, how do I get the access token that is returned in the second tab into my chrome extension so that the user can then use it to make api requests?

0 Answers
Related