EDCD / EDMarketConnector

Downloads commodity market and other station data from the game Elite: Dangerous for use with all popular online and offline trading tools.
GNU General Public License v2.0
991 stars 155 forks source link

EDMC does not handle authentication link properly when logging in #683

Closed Mr6647 closed 4 years ago

Mr6647 commented 4 years ago

EDMC does not handle the authentication link properly when logging in via browser.

Reproduction:

  1. Open EDMC
  2. Click Update
  3. Enter Frontier credentials in the browser window and click login
  4. Accept browser prompt to open link in EDMarketConnector.exe
  5. ?
  6. EDMC never changes status from "Logging in..." clicking update again just opens a new browser window.

Expected behavior EDMC should correctly login and update at step 5 of the above.

Additional context

Other 3rd party apps such as EDSM, Inara and fleetcarrier.space do authenticate correctly when refreshed. The 401 error is only experienced by EDMC. Windows defender is the only firewall on this PC and I've added an inbound and outbound exception for EDMarketConnector.exe.

Athanasius commented 4 years ago

EDSM etc working at least confirms this is unlikely an issue at Frontier's end, but they're all web apps receiving the callback on their website, whereas EDMC is trying to receive that at an edmc:// URL.

Do you have any extra (not Windows Defender) Anti-Virus installed?

The browser shouldn't be doing "browser prompt to open link in EDMarketConnector.exe" as you cite in your step 4. The browser should see the edmc:// URL, find that Windows has a handler for that registered, and just post the data directly to a thread in EDMarketConnector.exe. So either something is interfering with the setup of that thread/handler, or with the browser seeing that the protocol has a handler.

The lack of any exception trace in the log you provided tells us that EDMC didn't experience any overt trouble setting that handler up (although as it's Ctypes code we should check that to see if an exception would occur, or if we're not sufficiently checking return values).

Mr6647 commented 4 years ago

I do not have any anti-virus installed. Firefox is handling the edmc:// url as it should. The prompt I mentioned is standard when opening an application link (such as magnet:// or mailto://), as shown below. image If "Always use this app to open edmc links" is checked then the prompt does not appear. Also, if EDMC is closed after opening the login window and then the login button is pressed, then EDMC starts.

Mr6647 commented 4 years ago

It turns out it was an error on Frontier's end with my account. They did not say what the root cause was except that I shouldn't have had to reauthorize any of the third party apps, including EDMC. Whatever they did resolved the issue EDMC.

Athanasius commented 4 years ago

There's still something weird going on there, as I use Firefox (have for about 2 years now) and have never had the edmc://auth protocol URLs cause such a pop-up, it just works. Perhaps you have some Firefox setting twiddled to always ask the "first time" ?

Athanasius commented 4 years ago

Ah yes, if I go in and tell it to "always ask" then the popup in your screenshot appears. I'm 100% sure it never did before.