Hi

I am developing an Android app to upload GPX traces to OpenStreetMaps. I have registered my app and now I am testing it. But I don't manage to get a token. When I try it both servers (test and production) return the same error: 500 I have been googling a lot, I found this issue: https://github.com/openstreetmap/openstreetmap-website/issues/2222 And I registered a new app, but it fails too.

Thank you for your help.

Jesus Picornell

asked 04 Jan, 16:48

GlobalSpark's gravatar image

GlobalSpark
1113
accept rate: 0%

1

According to https://github.com/openstreetmap/openstreetmap-website/issues/1049#issuecomment-136450085 the problem is not an unknown client but an invalid signature.

(05 Jan, 06:48) scai ♦

Hi, I am testing Openstreetmaps OAuth using an Android app. This is the related code:

    ...
    OkHttpClient client = new OkHttpClient();

    String url3 = "https://master.apis.dev.openstreetmap.org/oauth/request_token";

    RequestBody formBody = new FormBody.Builder()
            .add("consumer_key", client_id)
            .add("consumer_secret", client_secret)
            .add("callback", "https://spark71.com")
            .build(); 
    Request request = new Request.Builder()
            .url(url3)
            .post(formBody)
            .build();

    client.newCall(request)
            .enqueue(new Callback() {
                @Override
                public void onFailure(final Call call, IOException e) {

...

Thank you

Jesus Picornell

(06 Jan, 19:31) GlobalSpark

You are being extremely thin with details, well actually you are giving us none.

Literally 100's of contributors use OAuth to authorize their apps for OpenStreetMap (note no "s") every day, so it clearly does work.

If you really want help, then you should at least

  • include a pointer to your source code repository or an extract o the relevant code
  • indicate which framework/library you are using.

UPDATE

You don't seem to be actually signing the request. While it is completely possible to do implement https://tools.ietf.org/html/rfc5849#section-3.1 yourself, you are going to be far better off using a library that does this for you. For example signpost or any other library that supports OAuth 1.0a.

PS: if you choose signpost you will need https://github.com/pakerfeldt/okhttp-signpost for use with OkHttp.

permanent link

answered 05 Jan, 20:25

SimonPoole's gravatar image

SimonPoole ♦
42.5k13309670
accept rate: 19%

edited 07 Jan, 09:47

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×265
×1
×1

question asked: 04 Jan, 16:48

question was seen: 260 times

last updated: 07 Jan, 09:47

powered by OSQA