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

Nothing happens when click on "Login in with Browser" button for some users. #2752

Closed
Marc-Spector opened this issue Jul 20, 2022 · 4 comments · Fixed by #2754
Closed

Nothing happens when click on "Login in with Browser" button for some users. #2752

Marc-Spector opened this issue Jul 20, 2022 · 4 comments · Fixed by #2754
Labels

Comments

@Marc-Spector
Copy link
Collaborator

The bug appears only when the user has some problems with permissions, UAC or something

To Reproduce

  1. Click Login in with Browser button

Log or error message

java.io.IOException: Cannot run program "rundll32": CreateProcess error=740, The requested operation requires elevation
	at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1143)
	at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1073)
	at java.base/java.lang.Runtime.exec(Runtime.java:594)
	at java.base/java.lang.Runtime.exec(Runtime.java:418)
	at java.base/java.lang.Runtime.exec(Runtime.java:315)
	at com.sun.javafx.application.HostServicesDelegate$StandaloneHostService.showDocument(HostServicesDelegate.java:141)
	at javafx.application.HostServices.showDocument(HostServices.java:115)
	at com.faforever.client.fx.PlatformService.showDocument(PlatformService.java:47)
	at com.faforever.client.login.OAuthValuesReceiver.lambda$receiveValues$2(OAuthValuesReceiver.java:79)
	at java.base/java.util.concurrent.CompletableFuture$AsyncRun.run(CompletableFuture.java:1804)
	at java.base/java.util.concurrent.CompletableFuture$AsyncRun.exec(CompletableFuture.java:1796)
	at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:373)
	at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1182)
	at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1655)
	at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1622)
	at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:165)
Caused by: java.io.IOException: CreateProcess error=740, The requested operation requires elevation
	at java.base/java.lang.ProcessImpl.create(Native Method)
	at java.base/java.lang.ProcessImpl.<init>(ProcessImpl.java:494)
	at java.base/java.lang.ProcessImpl.start(ProcessImpl.java:159)
	at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1110)
	... 15 more

Expected behavior
Show the error message to the user

Screenshots
No need

OS
Windows

@Marc-Spector
Copy link
Collaborator Author

But it happened. It looks like there's no way we can catch the exception
image

@Brutus5000
Copy link
Member

I'm not sure why it was done this way, but using rundll is supposed to be deprecated: https://devblogs.microsoft.com/oldnewthing/20130104-00/?p=5643

A "safer" alternative is https://www.geeksforgeeks.org/java-program-to-open-input-url-in-system-default-browser-in-windows/

But maybe that caused problems in the past? We could als try the awt version first and if that fails use rundll as a fallback.

@Marc-Spector
Copy link
Collaborator Author

https://bugs.java.com/bugdatabase/view_bug.do?bug_id=JDK-8264698
From the comment:

I am changing the issue type to Enhancement and lowering it to P4. There are currently no plans to implement this.

It's bad.

@Marc-Spector
Copy link
Collaborator Author

We can just copy the showDocument() method and fix the catch block

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
2 participants