Aman Aalam
Aman Aalam

Reputation: 11251

OAuth 1.0 Requests with Retrofit in Android

I am trying to access a Magento REST API in my Android app, using Retrofit.

What have I tried:

But none of them have worked.

Retrofit 1.7 and OkHttp2.0RC2 don't work well with SignPost (at least the way the article suggest)

And when I downgrade for things to work, I get error HTTP 500 Error saying Internal Server Error

The same credentials work using REST Client plugin for Firefox.

Is there a working solution for implementing OAuth requests with Retrofit, or any other option?

Much thanks in advance.

Upvotes: 4

Views: 4629

Answers (3)

LOG_TAG
LOG_TAG

Reputation: 20589

Give it a try to this fix pakerfeldt's signpost-retrofit (A Retrofit extension to oauth-signpost OAuth Core 1.0a standard) !

Other fixes you can try:

Upvotes: 4

Aman Aalam
Aman Aalam

Reputation: 11251

Turned out that the web server expected the Accept parameter in header, which I was missing but Firefox extension was adding.

That made the server return a 500 (sending a response telling about the error would have been wiser though)

Things are working fine now.

Thanks for giving your time!

Upvotes: 3

Dibzmania
Dibzmania

Reputation: 2014

I have tried authenticating using the magento REST api from plain java code using the scribe lib. So far it worked for me.

Upvotes: 1

Related Questions