cancel
Showing results for 
Search instead for 
Did you mean: 

magento Consumer is not authorized to access resources

magento Consumer is not authorized to access resources

HI,

 

All of a sudden i'm getting this error "magento Consumer is not authorized to access resources". Before it worked nicely. I have made rest api  callout to get the data. suddenly it is throwing the Error

 

 { "message": "Consumer is not authorized to access %resources", "parameters": { "resources": "Magento_Catalog:Smiley Tongueroducts" } }

 

Requested Query:-

http://host/magento2/rest/V1/products?searchCriteria=0

please help me... Thanks in advance...!

10 REPLIES 10

Re: magento Consumer is not authorized to access resources

Hello,

 

How are you trying to access, Postman or curl? Please share details.

Issue you are facing any specific API or facing in all API's. Please try to run get token api and check token is expired or working. 

 

Click on Kudos if it works for you. Cheers coding Smiley Happy

Manish Mittal
https://www.manishmittal.com/

Re: magento Consumer is not authorized to access resources

Hi @harish_padala

 

The main reason behind this is , your accesstoken gets expired - so kindly generate a new accesstoken and add it again to that rest api !

 

Then it will start working again same like previously it works !

 

Hope it helps

if issue solved,Click Kudos & Accept as Solution

Re: magento Consumer is not authorized to access resources

thanks for the reply.... I have created integration through admin panel and generated Access token, Access token secret, Consumer key Consumer secret. So I have pulled all the products data using this Query                                                                                                                          "http://xxx/xxx/rest/V1/products?searchCriteria=0".                                                                      it works fine. when I try to Query products by updated  using the query

http://XXXXXXXXXX/XXXXXXX/rest/V1/products?searchCriteria[filter_g‌​roups][0][filters][0‌​][field]=updated_at&searchCriteria[filter_groups][0][filters][0][value]=2018-08-24 08:35:37"

I can't able to get the data with it.

Re: magento Consumer is not authorized to access resources

Hi @harish_padala

 

So using this searchCriteria  you are still facing the same error ? consumer is not authorized access ? - 

if issue solved,Click Kudos & Accept as Solution

Re: magento Consumer is not authorized to access resources

Hi @Manthan Dave,

 

In the postman, I tried to make a callout with filter criteria and search criteria then it returns me

{
    "message": "Consumer is not authorized to access %resources",
    "parameters": {
        "resources": "Magento_Catalog::products"
}

But from salesforce when I make callout with only search criteria it gives me data with no error. But when I included the filter criteria it returns me

{"message":"Invalid signature"}

}

Re: magento Consumer is not authorized to access resources

Hi @harish_padala

 

So in the POSTMAN , have you passed the access token - on the header part ?

 

Like bearer your-access-token ? - because i have tested this with POSTMAN and its working at my end !

if issue solved,Click Kudos & Accept as Solution

Re: magento Consumer is not authorized to access resources

Hi @Manthan Dave,

 

I have tested in the postman now. it's working. but when I made callout from salesforce it gives me invalid signature. without filter criteria it is working fine in salesforce. I dont understand why it causing error with filter criteria.

Re: magento Consumer is not authorized to access resources

Hello @harish_padala,

 

Please make sure you have given access catalog resource in API tab for api user. Check here 

 

 

2018-09-06_11-37-46.jpg

--
If my answer is useful, please Accept as Solution & give Kudos

Re: magento Consumer is not authorized to access resources

Hi @harish_padala

 

ok i understand , if its working in postman that something is missing in the parameters on your curl API call.

 

Invalid signature - means something you have wrong pass in parameters or something is missing !

 

 

if issue solved,Click Kudos & Accept as Solution