[OSM-dev] oAuth PUT not working

Stephan Knauss osm at stephans-server.de
Sun Jan 15 17:39:28 GMT 2012


Hi,

I had a working PHP script to edit tags. It uses the pecl oauth library.

Now it stopped working. I suppose it is broken since the last changes on 
the OSM servers end of November. The script is rarely used so I just 
noticed the problem.

My token is valid.

It is possible to issue a GET request to read the preferences.
But it fails with a result 401 when trying to issue a PUT request for 
creating a changeset.

Is there anything I need to update on my side to make it work again or 
is the server side broken? Wiki mentions I have to use version 1.0 which 
the script seams to do.
http://wiki.openstreetmap.org/wiki/Oauth

I replaced some data by XXX:

This is working:
http://api.openstreetmap.org/api/0.6/user/preferences?oauth_consumer_key=XXX&oauth_signature_method=HMAC-SHA1&oauth_nonce=19951763504f130b4716dd67.25809464&oauth_timestamp=1326648135&oauth_version=1.0&oauth_token=XXX&oauth_signature=XXX

This fails:
[headers_sent] =>
PUT /api/0.6/changeset/create HTTP/1.1
User-Agent: PECL-OAuth/1.2.2
Host: api.openstreetmap.org
Accept: */*
Authorization: OAuth 
oauth_consumer_key="XXX",oauth_signature_method="HMAC-SHA1",oauth_nonce="20733262254f130b476499b0.46798374",oauth_timestamp="1326648135",oauth_version="1.0",oauth_token="XXX",oauth_signature="XXX"
Content-Length: 161
Content-Type: application/x-www-form-urlencoded

[headers_recv] =>
HTTP/1.1 401 Authorization Required
Date: Sun, 15 Jan 2012 17:22:15 GMT
Server: Apache/2.2.14 (Ubuntu)
X-Powered-By: Phusion Passenger (mod_rails/mod_rack) 3.0.11
WWW-Authenticate: Basic realm="Web Password"
X-UA-Compatible: IE=Edge,chrome=1
X-Runtime: 1.003074
Cache-Control: no-cache
Status: 401
Vary: Accept-Encoding
Content-Length: 25
Content-Type: text/html; charset=utf-8


Stephan




More information about the dev mailing list