Are there OAuth2 solutions for Magento

Access to the Magento API from the native client with JavaScript

Edit: Found a better way, see Solution 2 below

As mentioned in the comment, the SOAP API is the way to go.

Solution 1:

Suds worked for me with minor changes (using instead), but it's little more than creating a SOAP envelope for the call and returning the entire XML response.

Proof-of-concept implementation with jQuery Deferred for chaining requirements:

Application example:

Solution 2:

It turned out that writing your own API adapter can be very easy. Using the example of (dead link) I was able to write a clean module for a JSON-RPC adapter based on. It uses the same authentication and ACL as the SOAP and XML-RPC APIs.

To use the entry point, the new controller must be added to the route:

Update 02/2015: The link above is no longer there available , so I made my JSON-RPC adapter available as a full extension as an open source address:

My JS client now looks like this (again with JQuery.Deferred, but no additional third-party libraries for the API):

Note that all methods are redirected after signing in. The parameter is something like the parameter is an array or object with the method arguments.

Application example: