question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Chrome extension calls the launchWebAuthFlow callback with an undefined responseUrl

See original GitHub issue

I 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:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
ivarvhcommented, Jan 25, 2021

Ok, thanks for the information. I will close this as the issue does not seem to be related to the library after all.

0reactions
jasonnuttercommented, Jan 22, 2021

We have discovered that it works when we turn off the corporate VPN. But I can reach the authorization page from the browser. Is there any difference between the little login window chrome creates and the browser itself?

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).

Read more comments on GitHub >

github_iconTop Results From Across the Web

chrome.identity.launchWebAuthFlow callback returns an ...
In my development extension (which has identical code), the callback has an undefined redirect_url (the first argument in the callback ...
Read more >
chrome/common/extensions/api/identity.idl - chromium/src
Use the <code>chrome.identity</code> API to get OAuth2 access tokens. ... callback LaunchWebAuthFlowCallback = void (optional DOMString responseUrl);.
Read more >
chrome.identity - Chrome Developers
Use the chrome.identity API to get OAuth2 access tokens. ... Note: When called with a callback, instead of returning an object this function...
Read more >
chrome.identity - Google Chrome
chrome.identity ... launchWebAuthFlow(object details, function callback) ... important interactive token requests are initiated by UI in your app explaining ...
Read more >
1305421 - Implement chrome.identity api - Bugzilla@Mozilla
getAccounts(function callback) * getAuthToken − chrome.identity. ... These requests will be made with the extension as the origin so they will be ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found