0

I am trying to get the permanent access_token and access_token_secret from Mangento 1.9.

I have consumer_key and consumer_secret and have configured the required permission by following this link http://devdocs.magento.com/guides/m1x/api/rest/permission_settings/permission_settings.html

I have successfully generated the temporary access_token and access_token_secret. But while trying to generate the oauth_verifier I am getting:

An error occurred. Your authorization request is invalid.

How can I solve this problem?

Suresh Ram
  • 1,034
  • 3
  • 16
  • 40

1 Answers1

1

You can generate permanent access token and and token secrete using Postman.

Follow the link. How to use POSTMAN rest client with magento REST api with Oauth. How to get Token and Token Secret?

1) Create rest api consumer (Collect temporary consumer key and screte key from here)

2) Creat web -> admin role, given all the resource permision

3)Create magento admin user role->linked it with the Rest role username-username password-password

For getting the permenant access key and token

4)Oauth initiate GET request in postman will return temporary

oauth_token=---------------- oauth_token_secret=------------------ oauth_callback_confirmed=true

5)then o-auth authorize with parameter as a token(from the last request) simple GET request

6)The login form will open ->filled with the consumer role credentials and made a POST request

7)click on authorize will give the following in responce
"oauth_token": ----------------, "oauth_verifier": ----------------

8)making request with all the parameters will give

permenant token and secrete key:

oauth_token=----------------

oauth_token_secret=----------------

will have to use this tokens in headers while requesting resources.

In Postman in oauth1.0 filling all the tokens(select auto add params to header and params and keep empty parameter) and url http://yourhost/app/api/rest/customers will return all the customer

Community
  • 1
  • 1
Shrikant
  • 384
  • 2
  • 10
  • 1
    I have tried in postman. While trying to get oauth_verifier I am getting "An error occired. Your authorization request is invalid" error. – Suresh Ram Jul 27 '16 at 08:33
  • have you noticed that you have to do POST request, with form data. Also recheck url and parameters. If you fail at 2nd or 3rd step, you have to begin from 1st again :) – Shrikant Jul 27 '16 at 09:14
  • As per the details given in the link, while generating oauth_verifier, it will prompt for admin username and password. But In my case instead of prompting admin username and password. I am getting error prompt like this https://healthandmed.com/index.php/admin123/oauth_authorize – Suresh Ram Jul 27 '16 at 11:07
  • try logging out your magento admin panel, if you are using same browser. Make new(alt+n) oauth_authorize request. I think you are missing url params there – Shrikant Jul 27 '16 at 12:14
  • will share all the steps hope will help someone :) – Shrikant Jul 27 '16 at 12:16