cancel
Showing results for 
Search instead for 
Did you mean: 

Limited access for OAuth Authentication

Limited access for OAuth Authentication

I have a Magento store and an integration which is setup as a Super User.
If I use that integration with Bearer Token Authentication, I dont see any issue and everything is working fine.

But now when I use that integration with OAuth authentication, I can not access the whole Magento Data. And when I say whole, i tried different APIs so some got successful 200 and the others got 401

The consumer isn't authorized to access %resources

Is there some sort of scope defined per Authentication method ?

2 REPLIES 2

Re: Limited access for OAuth Authentication

Hello @rvermasuit41ad 

 

Yes, there are different scopes defined for each authentication method. The scope determines what data the integration is allowed to access. For example, the store scope allows the integration to access store data, while the customer scope allows the integration to access customer data.

When you use Bearer Token Authentication, you are essentially giving the integration full access to your Magento store. This is because Bearer Tokens are not scoped, and they allow the integration to access any data that is available to the user who created the token.

When you use OAuth Authentication, you can specify the scopes that you want to grant to the integration. This allows you to control what data the integration is allowed to access.

If you are getting a 401 error when you try to access certain APIs with OAuth Authentication, it means that you have not granted the integration the necessary scopes. To fix this, you need to go to the OAuth settings page in the Magento Admin and add the necessary scopes to the integration.

Here are the steps on how to do this:

  1. Go to Stores > Settings > Configuration from the Admin sidebar.
  2. Click on the Services > OAuth tab.
  3. Click on the Edit button for the integration that you are having problems with.
  4. In the Scopes section, add the necessary scopes.
  5. Click on the Save button.

Once you have added the necessary scopes, you should be able to access the APIs without getting a 401 error.

Was my answer helpful? You can accept it as a solution.
175+ Professional Extensions for M1 & M2
Need a developer?Just visit Contact Us Now

Re: Limited access for OAuth Authentication

Thanks for reply @theMageComp 

I have been here before in search of scope but there is nothing as such.
When you say "Edit" for integration, what are you referring to ?

image.png