Opened 5 years ago

Last modified 4 years ago

#21065 closed defect

OAuth Authentication fails for JOSM — at Version 4

Reported by: jBeata Owned by: team
Priority: major Milestone: 21.06
Component: Core Version:
Keywords: oauth Cc:

Description (last modified by Don-vip)

The fully automatic OAuth authentication fails for JOSM with the following error:

021-07-02 11:13:03.526 java[9163:91587] 2021-07-02 11:13:03.525 SEVERE: org.openstreetmap.josm.gui.oauth.OsmOAuthAuthorizationException: oauth.signpost.exception.OAuthCommunicationException: Communication with the service provider failed: stream is closed. Cause: oauth.signpost.exception.OAuthCommunicationException: Communication with the service provider failed: stream is closed. Cause: java.io.IOException: stream is closed
org.openstreetmap.josm.gui.oauth.OsmOAuthAuthorizationException: oauth.signpost.exception.OAuthCommunicationException: Communication with the service provider failed: stream is closed
	at org.openstreetmap.josm.gui.oauth.OsmOAuthAuthorizationClient.getAccessToken(OsmOAuthAuthorizationClient.java:148)
	at org.openstreetmap.josm.gui.oauth.FullyAutomaticAuthorizationUI$FullyAutomaticAuthorisationTask.realRun(FullyAutomaticAuthorizationUI.java:498)
	at org.openstreetmap.josm.gui.PleaseWaitRunnable.doRealRun(PleaseWaitRunnable.java:94)
	at org.openstreetmap.josm.gui.PleaseWaitRunnable.run(PleaseWaitRunnable.java:142)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at java.lang.Thread.run(Thread.java:748)
Caused by: oauth.signpost.exception.OAuthCommunicationException: Communication with the service provider failed: stream is closed
	at oauth.signpost.AbstractOAuthProvider.retrieveToken(AbstractOAuthProvider.java:218)
	at oauth.signpost.AbstractOAuthProvider.retrieveAccessToken(AbstractOAuthProvider.java:108)
	at org.openstreetmap.josm.gui.oauth.OsmOAuthAuthorizationClient.getAccessToken(OsmOAuthAuthorizationClient.java:143)
	... 6 more
Caused by: java.io.IOException: stream is closed
	at sun.net.www.protocol.http.HttpURLConnection$HttpInputStream.ensureOpen(HttpURLConnection.java:3427)
	at sun.net.www.protocol.http.HttpURLConnection$HttpInputStream.read(HttpURLConnection.java:3452)
	at org.openstreetmap.josm.io.ProgressInputStream.read(ProgressInputStream.java:49)
	at sun.nio.cs.StreamDecoder.readBytes(StreamDecoder.java:284)
	at sun.nio.cs.StreamDecoder.implRead(StreamDecoder.java:326)
	at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:178)
	at java.io.InputStreamReader.read(InputStreamReader.java:184)
	at java.io.BufferedReader.fill(BufferedReader.java:161)
	at java.io.BufferedReader.readLine(BufferedReader.java:324)
	at java.io.BufferedReader.readLine(BufferedReader.java:389)
	at oauth.signpost.AbstractOAuthProvider.handleUnexpectedResponse(AbstractOAuthProvider.java:235)
	at oauth.signpost.AbstractOAuthProvider.retrieveToken(AbstractOAuthProvider.java:193)
	... 8 more

2021-07-02 11:13:03.532 SEVERE: OAuth authorisation failed - <html>The automatic process for retrieving an OAuth Access Token<br>from the OSM server failed.<br><br>Please try again or choose another kind of authorisation process,<br>i.e. semi-automatic or manual authorisation.</html>
2021-07-02 11:13:03.533 java[9163:91589] 2021-07-02 11:13:03.532 SEVERE: OAuth authorisation failed - <html>The automatic process for retrieving an OAuth Access Token<br>from the OSM server failed.<br><br>Please try again or choose another kind of authorisation process,<br>i.e. semi-automatic or manual authorisation.</html>

Change History (4)

comment:1 by skyper, 5 years ago

Yes, can reproduce. Only semi-automatic works, at least, if logged in on OSM-website.

Might be a problem related to the switch to OAuth2, see #20768.

comment:2 by anonymous, 5 years ago

A similar issue has appeared in GNOME Maps: https://gitlab.gnome.org/GNOME/gnome-maps/-/issues/386

Instead of getting a page with the verification code and asking for confirmation for the application, it gets an HTML page containing:

"
Authorization request failed

You have denied application GNOME Maps access to your account.
"

I think this is basically the same issue.

comment:3 by Don-vip, 5 years ago

Keywords: oauth added
Milestone: 21.06

comment:4 by Don-vip, 5 years ago

Description: modified (diff)
Note: See TracTickets for help on using tickets.