Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't authorise #1843

Closed
DM-666 opened this issue Feb 5, 2023 · 10 comments · Fixed by #2108
Closed

Can't authorise #1843

DM-666 opened this issue Feb 5, 2023 · 10 comments · Fixed by #2108
Assignees
Labels
bug Staged Feature Complete and in Testing for Next Release unconfirmed An unconfirmed bug
Milestone

Comments

@DM-666
Copy link

DM-666 commented Feb 5, 2023

Please complete the following information:

  • Version: v5.8.1+d81c93c
  • Game Version: Horizons Live
  • OS: Windows 10
  • OS Locale: English
  • Browser: Chrome Version 108.0.5359.125 (Official Build) (64-bit)
  • Please attach BOTH log files, by dragging and dropping them into this input:
    1. %TEMP%\EDMarketConnector.log from immediately after the bug occurs (re-running the application overwrites this file).
    2. %TEMP%\EDMarketConnector\EDMarketConnector-debug.log. See Debug Log File. NB: If you don't have this log file then you're not running the latest version of the application and should update first to see if we already fixed the bug you're reporting.
      EDMarketConnector.log
      EDMarketConnector-debug.log

Describe the bug
After launch 2 tabs are opened in chrome:

  1. The server returned a "500 Internal Server Error". URL: https://auth.frontierstore.net/auth?response_type=code&audience=frontier,steam,epic&scope=auth
  2. This site can’t be reached. URL: capi%26client_id%3Dfb88d428-9110-475f-a3d2-dc151c2b9c7a%26code_challenge%3Dasdffv28wbpn-pz1q9w699q-o5uhh44lfemgzuxlwvq%26code_challenge_method%3Ds256%26state%3Dhiyttmozsgn6hffghjpwvkilynsjt6q1v9gbu3fqq2o%26redirect_uri%3Dedmc.
    App is stuck on 'Logging in...'

To Reproduce
Start EDMC

Expected behavior
One of the tabs should be a Frontier authorization page? As far as I can remember I never saw that page.

Screenshots
image

Additional context
Launching with EDMarketConnector - localserver-auth.bat does the same thing.
Reinstall doesn't help either

@DM-666 DM-666 added bug unconfirmed An unconfirmed bug labels Feb 5, 2023
@norohind
Copy link
Contributor

norohind commented Feb 5, 2023

Assuming you a bit messed up with formatting the issue message and both items under
Describe the bug means something like The server returned a "500 Internal Server Error". URL: https://auth.frontierstore.net/auth?response_type=code&audience=frontier,steam,epic&scope=auth%20capi&client_id=fb88d428-9110-475f-a3d2-dc151c2b9c7a&code_challenge=<code_challenge_here>&code_challenge_method=S256&state=<state_here>&redirect_uri=edmc://auth, it means there is a problem on FDEV side. Try to auth later, try if it's works on other tools which requires FDEV oAuth2.0 authentication and if problem persists, contact FDEV customer support. Also if you have the game in EGS (Epic Game Store) there might be problem on FDEV side which should be solved once you enter the game (though this case usually looks not like that).

@DM-666
Copy link
Author

DM-666 commented Feb 9, 2023

Excuse me for the late response, I wasn't able to check my mail.
The issue is that when I start EDMC - 2 tabs open in Chrome, both lead to nothing. The first URL looks like Frontier authorization link, but stuck at "500 Internal Server Error". The second URL looks like crap and ends up with "site can't be reached". The question is: is this an intended behavior? Should EDMC visit 2 links on startup? My guess is that it should be one link but it gets splitted in two somehow, causing a login error.
The problem exists a few weeks from the day that I installed EDMC. I used EDMC in the past without any issues, but it was like a year ago when a has Windows 7 on my PC.
I have ED on Steam. And what are the other tools requiring FDEV oAuth2.0 authentication? I would like to test them too

Edit: Thank you for an example of auth link. I have manually created a correct link by inserting my code_challenge and state there and frontier authorization page has been opened. Logged in, approved. So it looks like my Chrome doesn't understand a link and breaks him in two. Must be something with language settings...

@norohind
Copy link
Contributor

It's definitely not intended behavior. EDMarketConnector should open only one tab in order to auth, and it's URL should be as in the template I've specified.

There are actually space between two parts of URL you're facing as opening as two tabs. It seems something between EDMarketConnector's call to webbrowser.open() and actually opening browser window treats space as separator between two URLs. This space is intended to encode to %20, I don't know which software must encode it, though it always just worked. (And at first glance I haven't found anything related to url encoding in docs to webbrowser module or in it sources) (Current implementation in EDMarketConnector 5.8.1).
I've tested it with chrome 109.0.5414.120 64-bit official build and Firefox 109.0.1 64 bit (both windows) and it worked perfectly fine. In browser's address bar I saw url with encoded special symbols, including space encoded to %20.
Try to check it with another browser (you probably will need to set another browser as default). I've also noted your Chrome version isn't latest, may be upgrading to latest will solve the problem.

Other tools can be https://inara.cz and https://journal-limpet.com

@DM-666
Copy link
Author

DM-666 commented Feb 10, 2023

Thank you for your help. It must be something wrong with my Chrome. I will investigate it further. In the meantime, I will use a workaround with a manual link, it seems to work well.
Inara and journal-limpet.com working fine btw.
Anyway, thank you for your help, and the case is closed because it is definitely my local problem with Chrome

@DM-666 DM-666 closed this as completed Feb 10, 2023
@norohind
Copy link
Contributor

I would leave this issue as opened if next maintainer will want to look into actually encoding URL on EDMarketConnector side to prevent cases like this. Note that it mostly won't be addressed anytime soon as there is no active maintainer for now.

@DM-666 DM-666 reopened this Feb 10, 2023
@DM-666
Copy link
Author

DM-666 commented Feb 10, 2023

Good idea!

@Rixxan Rixxan added this to the 5.9.4 milestone Aug 4, 2023
@FireSammy
Copy link

Same problem, cannot authorize. Tried to change browser from Chrome to Edge. Didn't work either. Hope to get a new update soon, cheers

@Rixxan Rixxan self-assigned this Aug 31, 2023
@Rixxan
Copy link
Contributor

Rixxan commented Dec 10, 2023

Looking through this, I'm as of yet unable to replicate this issue. however, when looking at the URL parameters I do see where it's created as:

webbrowser.open(
f'{FRONTIER_AUTH_SERVER}{self.FRONTIER_AUTH_PATH_AUTH}?response_type=code'
f'&audience=frontier,steam,epic'
f'&scope=auth capi'
f'&client_id={self.CLIENT_ID}'
f'&code_challenge={challenge}'
f'&code_challenge_method=S256'
f'&state={self.state}'
f'&redirect_uri={protocol.protocolhandler.redirect}'
)

It's this f'&scope=auth capi' that I think might be causing the issue. (Perhaps, replace with a %20?)

Hesitant to make code changes without confirming this is the source.

@norohind
Copy link
Contributor

I ended up thinking that it's a problem with space in auth capi, though I have not found anything in webbrowser module's documentation about who should do url encoding.
And yes, this looks like some hard reproducible case.

Rixxan added a commit to HullSeals/EDMarketConnector that referenced this issue Dec 13, 2023
Replaces vague space with properly encoded %20. This SHOULD solve the issue, but I can't replicate the original issue.
@Rixxan Rixxan linked a pull request Dec 13, 2023 that will close this issue
@C1701D C1701D added the Staged Feature Complete and in Testing for Next Release label Dec 13, 2023
@DM-666
Copy link
Author

DM-666 commented Dec 14, 2023

Stepped away from Chrome and reinstalled Windows in the meantime. It works fine atm, thank you, guys, for fixing stuff and keep it alive!

@Rixxan Rixxan closed this as completed Dec 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Staged Feature Complete and in Testing for Next Release unconfirmed An unconfirmed bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants