Chrome extension calls the launchWebAuthFlow callback with an undefined responseUrl
See original GitHub issueI am trying to get msal to work with a chrome extension. I followed the chrome extension sample in this repo almost word for word. The only difference is that we do not use the common tenant, but our own enterprise tenant.
I click my button in the extension popup, a new window is created and navigates to microsoft login, I fill in the e-mail, click next, it shows the loading dots and then the window closes with an error in the console:
“Unchecked runtime.lastError: Authorization page could not be loaded.”
I added the redirect uri (https://<extension-id>.chromeapp.org) to the azure app registration. My manifest.json is as follows:
{ "name": "my extension", "version": "1.1", "description": "my extension", "manifest_version": 2, "permissions": [ "identity", "identity.email", "activeTab", "tabs", "storage" ], "web_accessible_resources": [ "index.html", "assets/*" ], "browser_action": { "default_popup": "index.html" }, "content_scripts": [ { "matches": [ "https://*/*" ], "js": [ "polyfills.js", "main.js", "runtime.js" ] } ] }
The javascript code is more or less the same as the sample.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:7 (3 by maintainers)
Top GitHub Comments
Ok, thanks for the information. I will close this as the issue does not seem to be related to the library after all.
Interesting, I have not heard of this issue before. Might be an issue with loading the
chromiumapp.org
domain on your vpn?My understanding is the browser auth dialogue has its own context, meaning while it can store cookies, those cookies (and other storage) is separate from the main browser window (and gets cleared when the browser is closed).