Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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:

  • SignPost and OkHttp to sign request using these classes : https://gist.github.com/f2prateek/0deb2d7ddea43e21d39b
  • Custom Headers having OAuth values

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.

like image 236
Aman Alam Avatar asked Feb 12 '23 16:02

Aman Alam


1 Answers

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:

  • Java wrapper for retrofit getglue-java.

  • OAuthClient by dzolnai.

  • Square's G+ discussion.

  • retrofit-oauth
like image 134
LOG_TAG Avatar answered Feb 24 '23 17:02

LOG_TAG