2

I've recently had some success on setting up a REST client via PHP to OAuth authenticate on a Magento 1.8.x backend. I've run the same process over on my Magento CE 1.9.1.0.

Expected authorisation screen:

enter image description here

What actually comes up:

enter image description here

Besides the design difference, it does seem that the router takes me to the frontend rather than the backend. I have created a new REST role called Admin with full privileges and have added my main admin user to that role (same process that I used on Magento CE 1.8.x).

Has anyone else experienced this? Could this possibly be a bug?

It seems that no matter what I type into the 'Log In As A Customer' screen, I get redirected to the main customer login page.

My endpoints are as follows:

$callbackUrl = "http://foo.bar/test.php";
$temporaryCredentialsRequestUrl = "http://foo.bar/oauth/initiate?oauth_callback=" . urlencode($callbackUrl);
$adminAuthorizationUrl = 'http://foo.bar/oauth/authorize';
$accessTokenRequestUrl = 'http://foo.bar/oauth/token';
$apiUrl = 'http://foo.bar/api/rest';
4

It seams to work fine for me.
I get the admin authentication screen.
I think you may have used thisthe authorization url http://magento.root/oauth/authorize instead of http://magento.root/admin/oauth_authorize.

See the examples provided in here.
There are 2 of them. One for admin access and one for customer access. Use the first one Create a simple product as an Admin user with OAuth authentication.

[EDIT]
Urls should look like this:

$callbackUrl = "http://foo.bar/test.php";
$temporaryCredentialsRequestUrl = "http://foo.bar/oauth/initiate?oauth_callback=" . urlencode($callbackUrl);
$adminAuthorizationUrl = 'http://foo.bar/admin/oauth_authorize'; //this is what you need.
$accessTokenRequestUrl = 'http://foo.bar/oauth/token';
$apiUrl = 'http://foo.bar/api/rest';
  • Thanks Marius. Do you mind posting your endpoints? I have edited my question to include this. – Francis Kim Dec 11 '14 at 10:06
  • @FrancisKim Done. – Marius Dec 11 '14 at 10:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.