client icon indicating copy to clipboard operation
client copied to clipboard

sometimes oidc / oauth2 redirect URL port resets to 0

Open butonic opened this issue 2 years ago • 5 comments

Pre-submission Checks

  • [X] I checked for similar issues, but could not find any. I also checked the closed issues. I could not contribute additional information to any existing issue.
  • [X] I will take the time to fill in all the required fields. I know that the bug report may be dismissed otherwise due to lack of information.

Describe the bug

Toying around with oidc I clicked "reopen browser" but the url that was produced started with http://127.0.0.1:0/?code=... ... which won't work when the browser tries to redirect to it.

Expected behavior

It should always use the random port of the localhost server.

Steps to reproduce the issue

I tried to reproduce this by restarting the idp several times and wiping its account tokens and sessions ... but I feel it is caused by the clients local server timing out?

Screenshots

No response

Logs

No response

Client version number

ownCloud 2.10.1 (build 7187) 82eefd Apr 5 2022 04:25:21 Libraries Qt 5.12.11, OpenSSL 1.1.1k 25 Mar 2021 verwenden das Virtual Files plugin: wincfapi windows-10.0.25136

Desktop environment (Linux only)

No response

Client package version and origin (Linux only)

No response

Installation path (Windows only)

C:\Program Files (x86)\ownCloud

Server information

ocis master

Additional context

No response

butonic avatar Jun 14 '22 11:06 butonic

This issue was marked stale because it has been open for 30 days with no activity. Remove the stale label or comment or this will be closed in 7 days.

github-actions[bot] avatar Jul 15 '22 00:07 github-actions[bot]

@butonic usually this happens if you opened multiple auth windows, only one will succeed. If an error occurs during auth we will also restart the process so well start on a new port.

TheOneRing avatar Jul 15 '22 06:07 TheOneRing

This issue was marked stale because it has been open for 30 days with no activity. Remove the stale label or comment or this will be closed in 7 days.

github-actions[bot] avatar Aug 16 '22 00:08 github-actions[bot]

@fmoc I think your currently looking into it

TheOneRing avatar Aug 16 '22 07:08 TheOneRing

Nope. I'm fixing the case where the OAuth object goes into an error state and the URL is reset to an empty string. But I'll have a look.

fmoc avatar Aug 16 '22 08:08 fmoc

See https://doc.qt.io/qt-6/qabstracthttpserver.html, we should replace our own implementation with a proper HTTP server. Obviously adds a dependency on #10701.

fmoc avatar Apr 13 '23 10:04 fmoc