Magento 2.3. Need to grant access to customer for using some APIsRedis vs Memcached for Magento 2.3?How to add a Customer Attribute in a custom module using declarative schema in Magento 2.3?Magento 2.3 Install failed … Invalid Index using addColumn methodMagento 2.3 add Product scriptMagento 2.3 Readiness Check FailingMagento 2.3 - Need detail about some newly introduced featureMagento 2.3 : Insert data into table using DeclarativeSchemaMagento 2.3 Data Transfer ImportWhat is Asynchronous Web APIs in Magento 2.3?Magento 2.3, patch PRODSECBUG-2198-2.3-CE-2019

Does int main() need a declaration on C++?

What do you call someone who asks many questions?

How to show a landlord what we have in savings?

Do Iron Man suits sport waste management systems?

How to compactly explain secondary and tertiary characters without resorting to stereotypes?

Can compressed videos be decoded back to their uncompresed original format?

Finitely generated matrix groups whose eigenvalues are all algebraic

Mathematica command that allows it to read my intentions

How to travel to Japan while expressing milk?

Can a virus destroy the BIOS of a modern computer?

Sums of two squares in arithmetic progressions

Is it possible to create a QR code using text?

Getting extremely large arrows with tikzcd

How do conventional missiles fly?

Pact of Blade Warlock with Dancing Blade

How can I deal with my CEO asking me to hire someone with a higher salary than me, a co-founder?

Why is it a bad idea to hire a hitman to eliminate most corrupt politicians?

How to prevent "they're falling in love" trope

Convert seconds to minutes

Can I hook these wires up to find the connection to a dead outlet?

What exactly is ineptocracy?

How do I exit BASH while loop using modulus operator?

Why were 5.25" floppy drives cheaper than 8"?

Is this draw by repetition?



Magento 2.3. Need to grant access to customer for using some APIs


Redis vs Memcached for Magento 2.3?How to add a Customer Attribute in a custom module using declarative schema in Magento 2.3?Magento 2.3 Install failed … Invalid Index using addColumn methodMagento 2.3 add Product scriptMagento 2.3 Readiness Check FailingMagento 2.3 - Need detail about some newly introduced featureMagento 2.3 : Insert data into table using DeclarativeSchemaMagento 2.3 Data Transfer ImportWhat is Asynchronous Web APIs in Magento 2.3?Magento 2.3, patch PRODSECBUG-2198-2.3-CE-2019













1















I have gone through from regular authentication process as a customer and successfully used some Magento Rest APIs. Some APIs are working fine and some apis are returning responses like that;



Example: I need to get details of a specific product:



Endpoint: /V1/products/sku

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



As admin, I can access these resources. But I need to access these resources as a customer.



I am using community edition of Magento 2.3.



I need to ask how can I grant access to customer and guest user of these resources.










share|improve this question







New contributor




Hasan Ilyas is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
























    1















    I have gone through from regular authentication process as a customer and successfully used some Magento Rest APIs. Some APIs are working fine and some apis are returning responses like that;



    Example: I need to get details of a specific product:



    Endpoint: /V1/products/sku

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



    As admin, I can access these resources. But I need to access these resources as a customer.



    I am using community edition of Magento 2.3.



    I need to ask how can I grant access to customer and guest user of these resources.










    share|improve this question







    New contributor




    Hasan Ilyas is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
    Check out our Code of Conduct.






















      1












      1








      1








      I have gone through from regular authentication process as a customer and successfully used some Magento Rest APIs. Some APIs are working fine and some apis are returning responses like that;



      Example: I need to get details of a specific product:



      Endpoint: /V1/products/sku

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



      As admin, I can access these resources. But I need to access these resources as a customer.



      I am using community edition of Magento 2.3.



      I need to ask how can I grant access to customer and guest user of these resources.










      share|improve this question







      New contributor




      Hasan Ilyas is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.












      I have gone through from regular authentication process as a customer and successfully used some Magento Rest APIs. Some APIs are working fine and some apis are returning responses like that;



      Example: I need to get details of a specific product:



      Endpoint: /V1/products/sku

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



      As admin, I can access these resources. But I need to access these resources as a customer.



      I am using community edition of Magento 2.3.



      I need to ask how can I grant access to customer and guest user of these resources.







      magento2.3






      share|improve this question







      New contributor




      Hasan Ilyas is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.











      share|improve this question







      New contributor




      Hasan Ilyas is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.









      share|improve this question




      share|improve this question






      New contributor




      Hasan Ilyas is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.









      asked 2 days ago









      Hasan IlyasHasan Ilyas

      61




      61




      New contributor




      Hasan Ilyas is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.





      New contributor





      Hasan Ilyas is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.






      Hasan Ilyas is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.




















          1 Answer
          1






          active

          oldest

          votes


















          0














          By default User type Customer has Accessible resources (defined in webapi.xml) with anonymous or self permission.



          The rest API endpoint /V1/products/sku has a resource ref of "Magento_Catalog::products" that's why customer has no access on it.

          In order to access it using customer's token, you have to create a custom endpoint that will extend a specific API endpoint with <resource ref="self"/>
          Check below example:



          <?xml version="1.0"?>
          <routes xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Webapi:etc/webapi.xsd">
          <route url="/V1/products/product:sku" method="GET">
          <service class="MagentoCatalogApiProductRepositoryInterface" method="get"/>
          <resources>
          <resource ref="sef" />
          </resources>
          </route>
          </routes>


          And you can use the custom endpoint /V1/products/product/sku to get details of the specific product using customer's token.






          share|improve this answer























            Your Answer








            StackExchange.ready(function()
            var channelOptions =
            tags: "".split(" "),
            id: "479"
            ;
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function()
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled)
            StackExchange.using("snippets", function()
            createEditor();
            );

            else
            createEditor();

            );

            function createEditor()
            StackExchange.prepareEditor(
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: false,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: null,
            bindNavPrevention: true,
            postfix: "",
            imageUploader:
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            ,
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            );



            );






            Hasan Ilyas is a new contributor. Be nice, and check out our Code of Conduct.









            draft saved

            draft discarded


















            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f268085%2fmagento-2-3-need-to-grant-access-to-customer-for-using-some-apis%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown

























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            0














            By default User type Customer has Accessible resources (defined in webapi.xml) with anonymous or self permission.



            The rest API endpoint /V1/products/sku has a resource ref of "Magento_Catalog::products" that's why customer has no access on it.

            In order to access it using customer's token, you have to create a custom endpoint that will extend a specific API endpoint with <resource ref="self"/>
            Check below example:



            <?xml version="1.0"?>
            <routes xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
            xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Webapi:etc/webapi.xsd">
            <route url="/V1/products/product:sku" method="GET">
            <service class="MagentoCatalogApiProductRepositoryInterface" method="get"/>
            <resources>
            <resource ref="sef" />
            </resources>
            </route>
            </routes>


            And you can use the custom endpoint /V1/products/product/sku to get details of the specific product using customer's token.






            share|improve this answer



























              0














              By default User type Customer has Accessible resources (defined in webapi.xml) with anonymous or self permission.



              The rest API endpoint /V1/products/sku has a resource ref of "Magento_Catalog::products" that's why customer has no access on it.

              In order to access it using customer's token, you have to create a custom endpoint that will extend a specific API endpoint with <resource ref="self"/>
              Check below example:



              <?xml version="1.0"?>
              <routes xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
              xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Webapi:etc/webapi.xsd">
              <route url="/V1/products/product:sku" method="GET">
              <service class="MagentoCatalogApiProductRepositoryInterface" method="get"/>
              <resources>
              <resource ref="sef" />
              </resources>
              </route>
              </routes>


              And you can use the custom endpoint /V1/products/product/sku to get details of the specific product using customer's token.






              share|improve this answer

























                0












                0








                0







                By default User type Customer has Accessible resources (defined in webapi.xml) with anonymous or self permission.



                The rest API endpoint /V1/products/sku has a resource ref of "Magento_Catalog::products" that's why customer has no access on it.

                In order to access it using customer's token, you have to create a custom endpoint that will extend a specific API endpoint with <resource ref="self"/>
                Check below example:



                <?xml version="1.0"?>
                <routes xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Webapi:etc/webapi.xsd">
                <route url="/V1/products/product:sku" method="GET">
                <service class="MagentoCatalogApiProductRepositoryInterface" method="get"/>
                <resources>
                <resource ref="sef" />
                </resources>
                </route>
                </routes>


                And you can use the custom endpoint /V1/products/product/sku to get details of the specific product using customer's token.






                share|improve this answer













                By default User type Customer has Accessible resources (defined in webapi.xml) with anonymous or self permission.



                The rest API endpoint /V1/products/sku has a resource ref of "Magento_Catalog::products" that's why customer has no access on it.

                In order to access it using customer's token, you have to create a custom endpoint that will extend a specific API endpoint with <resource ref="self"/>
                Check below example:



                <?xml version="1.0"?>
                <routes xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Webapi:etc/webapi.xsd">
                <route url="/V1/products/product:sku" method="GET">
                <service class="MagentoCatalogApiProductRepositoryInterface" method="get"/>
                <resources>
                <resource ref="sef" />
                </resources>
                </route>
                </routes>


                And you can use the custom endpoint /V1/products/product/sku to get details of the specific product using customer's token.







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered 2 days ago









                magefmsmagefms

                2,2302426




                2,2302426




















                    Hasan Ilyas is a new contributor. Be nice, and check out our Code of Conduct.









                    draft saved

                    draft discarded


















                    Hasan Ilyas is a new contributor. Be nice, and check out our Code of Conduct.












                    Hasan Ilyas is a new contributor. Be nice, and check out our Code of Conduct.











                    Hasan Ilyas is a new contributor. Be nice, and check out our Code of Conduct.














                    Thanks for contributing an answer to Magento Stack Exchange!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid


                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.

                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function ()
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f268085%2fmagento-2-3-need-to-grant-access-to-customer-for-using-some-apis%23new-answer', 'question_page');

                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    Bulk add to cart function issuecart vs. mini cart issue … rwd themeRedirect Add to cart button to cart pageAdd to cart issue - Magento 2.1The requested Payment Method is not available When creating an orderM2: reason add-to-cart might not function in production modeAdd to cart issue in some android devicesMagento 2 - custom price can not add to subtotal and grand total after add to cartAdd to cart codeIssue with my cart module on pdp and cart pages, just keeps spinningBulk price and quantity update using rest api

                    БиармияSxpst500bh2ntaf! 3h2r