Modify

Opened 4 years ago

Closed 4 years ago

#12236 closed defect (fixed)

OAuth broken

Reported by: malenki Owned by: team
Priority: blocker Milestone: 15.12
Component: Core Version:
Keywords: regression http oauth Cc:

Description

In r9176 OAuth doesn't work anymore. It tells the user so and asks that he should get a new authentication code - but after doing so Auth still fails.

openjdk version "1.8.0_66-internal"
OpenJDK Runtime Environment (build 1.8.0_66-internal-b01)
OpenJDK 64-Bit Server VM (build 25.66-b01, mixed mode

INFO: PUT https://api.openstreetmap.org/api/0.6/changeset/create -> 200
INFO: OK
INFO: POST https://api.openstreetmap.org/api/0.6/changeset/36190057/upload -> 401
INFO: Unauthorized
Fehler: Error body: Couldn't authenticate you
Fehler: org.openstreetmap.josm.io.OsmApiException: ResponseCode=401, Error Body=<Couldnt authenticate you>
org.openstreetmap.josm.io.OsmApiException: ResponseCode=401, Error Body=<Couldnt authenticate you>
	at org.openstreetmap.josm.io.OsmApi.sendRequest(OsmApi.java:678)
	at org.openstreetmap.josm.io.OsmApi.sendRequest(OsmApi.java:590)
	at org.openstreetmap.josm.io.OsmApi.uploadDiff(OsmApi.java:533)
	at org.openstreetmap.josm.io.OsmServerWriter.uploadChangesInChunks(OsmServerWriter.java:175)
	at org.openstreetmap.josm.io.OsmServerWriter.uploadOsm(OsmServerWriter.java:218)
	at org.openstreetmap.josm.gui.io.UploadPrimitivesTask.realRun(UploadPrimitivesTask.java:250)
	at org.openstreetmap.josm.gui.PleaseWaitRunnable.doRealRun(PleaseWaitRunnable.java:93)
	at org.openstreetmap.josm.gui.PleaseWaitRunnable.run(PleaseWaitRunnable.java:161)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:745)
INFO: PUT https://api.openstreetmap.org/api/0.6/changeset/36190057 -> 200
INFO: OK
INFO: POST https://api.openstreetmap.org/api/0.6/changeset/36190057/upload -> 401
INFO: Unauthorized
Fehler: Error body: Couldn't authenticate you
Fehler: org.openstreetmap.josm.io.OsmApiException: ResponseCode=401, Error Body=<Couldnt authenticate you>
org.openstreetmap.josm.io.OsmApiException: ResponseCode=401, Error Body=<Couldnt authenticate you>
	at org.openstreetmap.josm.io.OsmApi.sendRequest(OsmApi.java:678)
	at org.openstreetmap.josm.io.OsmApi.sendRequest(OsmApi.java:590)
	at org.openstreetmap.josm.io.OsmApi.uploadDiff(OsmApi.java:533)
	at org.openstreetmap.josm.io.OsmServerWriter.uploadChangesInChunks(OsmServerWriter.java:175)
	at org.openstreetmap.josm.io.OsmServerWriter.uploadOsm(OsmServerWriter.java:218)
	at org.openstreetmap.josm.gui.io.UploadPrimitivesTask.realRun(UploadPrimitivesTask.java:250)
	at org.openstreetmap.josm.gui.PleaseWaitRunnable.doRealRun(PleaseWaitRunnable.java:93)
	at org.openstreetmap.josm.gui.PleaseWaitRunnable.run(PleaseWaitRunnable.java:161)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:745)

Attachments (0)

Change History (9)

comment:1 Changed 4 years ago by Klumbumbus

same here

INFO: Unauthorized
Fehler: Error body: Couldn't authenticate you
Fehler: org.openstreetmap.josm.io.OsmApiException: ResponseCode=401, Error Body=<Couldnt authenticate you>
org.openstreetmap.josm.io.OsmApiException: ResponseCode=401, Error Body=<Couldnt authenticate you>
	at org.openstreetmap.josm.io.OsmApi.sendRequest(OsmApi.java:678)
	at org.openstreetmap.josm.io.OsmApi.sendRequest(OsmApi.java:590)
	at org.openstreetmap.josm.io.OsmApi.uploadDiff(OsmApi.java:533)
	at org.openstreetmap.josm.io.OsmServerWriter.uploadChangesAsDiffUpload(OsmServerWriter.java:134)
	at org.openstreetmap.josm.io.OsmServerWriter.uploadOsm(OsmServerWriter.java:212)
	at org.openstreetmap.josm.gui.io.UploadPrimitivesTask.realRun(UploadPrimitivesTask.java:250)
	at org.openstreetmap.josm.gui.PleaseWaitRunnable.doRealRun(PleaseWaitRunnable.java:93)
	at org.openstreetmap.josm.gui.PleaseWaitRunnable.run(PleaseWaitRunnable.java:161)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
	at java.lang.Thread.run(Unknown Source)
INFO: GET https://www.openstreetmap.org/oauth/request_token -> 200
INFO: Öffne URL: https://www.openstreetmap.org/oauth/authorize?oauth_token=xxxxxxxxxxxxxx
INFO: GET https://www.openstreetmap.org/oauth/access_token -> 200
INFO: GET https://api.openstreetmap.org/api/0.6/user/details -> 200
INFO: GET https://api.openstreetmap.org/api/0.6/user/details -> 200
INFO: PUT https://api.openstreetmap.org/api/0.6/changeset/36205105 -> 200
INFO: OK
INFO: POST https://api.openstreetmap.org/api/0.6/changeset/36205105/upload -> 401
INFO: Unauthorized

URL:http://josm.openstreetmap.de/svn/trunk
Repository:UUID: 0c6e7542-c601-0410-84e7-c038aed88b3b
Last:Changed Date: 2015-12-27 16:51:12 +0100 (Sun, 27 Dec 2015)
Build-Date:2015-12-27 16:17:15
Revision:9181
Relative:URL: ^/trunk

Identification: JOSM/1.5 (9181 de) Windows 7 32-Bit
Memory Usage: 247 MB / 742 MB (68 MB allocated, but free)
Java version: 1.8.0_66, Oracle Corporation, Java HotSpot(TM) Client VM
VM arguments: [-Djava.security.manager, -Djava.security.policy=file:C:\Program Files\Java\jre1.8.0_66\lib\security\javaws.policy, -DtrustProxy=true, -Djnlpx.home=<java.home>\bin, -Djnlpx.origFilenameArg=C:\Program Files\josm-latest-bla.jnlp, -Djnlpx.remove=true, -Djava.util.Arrays.useLegacyMergeSort=true, -Djnlpx.heapsize=256m,768m, -Djnlpx.splashport=59684, -Djnlpx.jvm=<java.home>\bin\javaw.exe, -Djnlpx.vmargs=LURqYXZhLnV0aWwuQXJyYXlzLnVzZUxlZ2FjeU1lcmdlU29ydD10cnVlAA==]
Dataset consistency test: No problems found

Plugins:
- AddrInterpolation (31772)
- DirectDownload (31772)
- DirectUpload (31871)
- HouseNumberTaggingTool (31772)
- OpeningHoursEditor (31772)
- PicLayer (31772)
- RoadSigns (31772)
- apache-commons (31772)
- buildings_tools (31772)
- download_along (31772)
- editgpx (31772)
- imagery_offset_db (31772)
- importvec (31772)
- log4j (31772)
- measurement (31772)
- photo_geotagging (31772)
- photoadjust (31772)
- public_transport (31772)
- reltoolbox (31772)
- reverter (31772)
- tag2link (31867)
- tageditor (31772)
- tagging-preset-tester (31772)
- terracer (31772)
- turnlanes (31772)
- turnrestrictions (31772)
- undelete (31772)
- utilsplugin2 (31772)
- wikipedia (31866)

Last errors/warnings:
- E: org.openstreetmap.josm.io.OsmApiException: ResponseCode=401, Error Body=<Couldnt authenticate you>
- E: Error body: Couldn't authenticate you
- E: org.openstreetmap.josm.io.OsmApiException: ResponseCode=401, Error Body=<Couldnt authenticate you>
- E: Error body: Couldn't authenticate you
- E: org.openstreetmap.josm.io.OsmApiException: ResponseCode=401, Error Body=<Couldnt authenticate you>

comment:2 Changed 4 years ago by simon04

Milestone: 15.12

comment:3 Changed 4 years ago by stoecker

See #12231. I assume changes there cause this.

comment:4 Changed 4 years ago by Don-vip

Keywords: http oauth added

comment:5 Changed 4 years ago by simon04

Strange, I tested before committing the changes (esp,. r9172) and right away – both times w/o problems:

// modified preference.xml and invalidated the oauth.access-token.key, oauth.access-token.secret entries by removing one character

// clicked "Test Access Token"

INFO: GET https://api.openstreetmap.org/api/0.6/user/details -> 401
ERROR: org.openstreetmap.josm.io.OsmApiException: ResponseCode=401, Error Header=<Retrieving user details with Access Token Key [[invalid token]] was rejected.>
org.openstreetmap.josm.io.OsmApiException: ResponseCode=401, Error Header=<Retrieving user details with Access Token Key [[invalid token]] was rejected.>
	at org.openstreetmap.josm.gui.oauth.TestAccessTokenTask.getUserDetails(TestAccessTokenTask.java:114)
	at org.openstreetmap.josm.gui.oauth.TestAccessTokenTask.realRun(TestAccessTokenTask.java:246)
	at org.openstreetmap.josm.gui.PleaseWaitRunnable.doRealRun(PleaseWaitRunnable.java:93)
	at org.openstreetmap.josm.gui.PleaseWaitRunnable.run(PleaseWaitRunnable.java:161)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:745)

INFO: PUT https://api.openstreetmap.org/api/0.6/changeset/create (0 kB) ...
INFO: PUT https://api.openstreetmap.org/api/0.6/changeset/create -> 401
INFO: Unauthorized
ERROR: Error body: Couldn't authenticate you
ERROR: org.openstreetmap.josm.io.OsmApiException: ResponseCode=401, Error Body=<Couldnt authenticate you>
org.openstreetmap.josm.io.OsmApiException: ResponseCode=401, Error Body=<Couldnt authenticate you>
	at org.openstreetmap.josm.io.OsmApi.sendRequest(OsmApi.java:683)
	at org.openstreetmap.josm.io.OsmApi.sendRequest(OsmApi.java:590)
	at org.openstreetmap.josm.io.OsmApi.openChangeset(OsmApi.java:420)
	at org.openstreetmap.josm.io.OsmServerWriter.uploadOsm(OsmServerWriter.java:205)
	at org.openstreetmap.josm.gui.io.UploadPrimitivesTask.realRun(UploadPrimitivesTask.java:250)
	at org.openstreetmap.josm.gui.PleaseWaitRunnable.doRealRun(PleaseWaitRunnable.java:93)
	at org.openstreetmap.josm.gui.PleaseWaitRunnable.run(PleaseWaitRunnable.java:161)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:745)

// clicked "New Access Token" and performed the semi-automatic mode

INFO: GET https://www.openstreetmap.org/oauth/request_token -> 200
INFO: Opening URL: https://www.openstreetmap.org/oauth/authorize?oauth_token=[[foobar]]
INFO: GET https://www.openstreetmap.org/oauth/access_token -> 200
INFO: GET https://api.openstreetmap.org/api/0.6/user/details -> 200
INFO: GET https://api.openstreetmap.org/api/0.6/user/details -> 200

// upload some changes

INFO: PUT https://api.openstreetmap.org/api/0.6/changeset/create (0 kB) ...
INFO: PUT https://api.openstreetmap.org/api/0.6/changeset/create -> 200
INFO: OK
INFO: POST https://api.openstreetmap.org/api/0.6/changeset/36206879/upload (2 kB) ...
INFO: POST https://api.openstreetmap.org/api/0.6/changeset/36206879/upload -> 200
INFO: OK
INFO: PUT https://api.openstreetmap.org/api/0.6/changeset/36206879/close (0 kB) ...
INFO: PUT https://api.openstreetmap.org/api/0.6/changeset/36206879/close -> 200
INFO: OK
Build-Date:2015-12-27 18:05:56
Revision:9181
Is-Local-Build:true

Identification: JOSM/1.5 (9181 SVN en) Linux Arch Linux
Memory Usage: 874 MB / 3504 MB (303 MB allocated, but free)
Java version: 1.8.0_66, Oracle Corporation, OpenJDK 64-Bit Server VM
VM arguments: [-agentlib:jdwp=transport=dt_socket,address=127.0.0.1:43813,suspend=y,server=n, -Djosm.home=/tmp/.josm, -javaagent:/usr/share/intellijidea-ce/plugins/Groovy/lib/agent/gragent.jar, -Dfile.encoding=UTF-8]
Program arguments: [--set=expert=true, --set=remotecontrol.enabled=true, --set=dialog.dynamic.buttons=false]
Dataset consistency test: No problems found

comment:6 Changed 4 years ago by Klumbumbus

When I click on the test button it says that the test was succesful, however osm data upload fails.

comment:7 Changed 4 years ago by simon04

Would you please test with r9182 (which can be downloaded from https://josm.openstreetmap.de/jenkins/view/JOSM/job/JOSM/lastCompletedBuild/jdk=JDK8/) and clean preferences?

comment:8 Changed 4 years ago by Klumbumbus

r9182 works for me

comment:9 Changed 4 years ago by simon04

Resolution: fixed
Status: newclosed

Thanks for testing!

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain team.
as The resolution will be set.
The resolution will be deleted.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.