mxch
mxch

Reputation: 855

Magento REST API OAuth for mobile app

I'm developing an iOS app that uses the Magento REST API, I'm following the documentation provided by Magento for the OAuth authentication (http://www.magentocommerce.com/api/rest/authentication/oauth_authentication.html)

I use the initiate endpoint to get the request token but then when I want to authorize this token I need to use the "authorize" endpoint and there I get redirected to a URL where I have to provide customer credentials to authorize the request token. This is not the behaviour that I was expecting since the user would be already logged in using the app's login (not implemented yet). Is there a way of making this "authorization" step transparent for the user? Like calling some service passing it the user's credentials provided in the login screen of my app?

If there is no way I'll use the Magento's SOAP API

Upvotes: 1

Views: 2229

Answers (1)

Andrea
Andrea

Reputation: 26385

I did that too really really painful Magento use OAuth1.x, basically you've got three options:

  1. Do it yourself
  2. Use some oAuth consumer lib, you can find them on github
  3. Use MKNetworkKit with this add-on I used the 3rd because oaf MKNetworkKit, and anyway there was still a lot of work to do, if you want to hide some passages injecting js.

Upvotes: 2

Related Questions