Hitachi Vantara Pentaho Community Forums
Results 1 to 6 of 6

Thread: Magento 2 oauth 1.0

  1. #1
    Join Date
    Feb 2017
    Posts
    4

    Default Magento 2 oauth 1.0

    Hi,

    I've just configured a rest API in Magento 2.1 - I want to connect Kettle with magento 2 through the Rest Client, but unfortunaztely the REst Client only purpose basic authentication !

    I have all the reqquested oauth 1.0 paramaters from magento2 API, so is there a way to make that work?

    Thank you for your answers,

    BR

    Thomas

  2. #2
    Join Date
    Jun 2012
    Posts
    5,534

    Default

    You should omit authentication from the REST-Client step.
    Use one of the Scripting steps for OAuth authentication: Modified-Java-Script-Value or User-Defined-Java-Class.
    Looking for a Java OAuth Client library I found ScribeJava.
    So long, and thanks for all the fish.

  3. #3
    Join Date
    Feb 2017
    Posts
    4

    Default

    Hi Marabu,

    Thank you for your reply; unfortunately, I'm a newbie with Kettle, could I ask you for more details for a "how-to"?

    BR,
    Thomas

  4. #4
    Join Date
    Jun 2012
    Posts
    5,534

    Default

    Kettle doesn't help you very much with the OAuth protocol, right now.
    We all can help you with the REST-client step configuration, but at first you need a solution for acquiring an OAuth access token as described on the Magento site.
    No big deal for a Java programmer to write a small Java class for ScribeJava to encapsulate the Magento OAuth API.
    Then, I would use one of the Scripting steps I mentioned to retrieve the access token.
    You see, it's not so much about Kettle.
    What you need is a good understanding of the OAuth protocol and some basic Java skills.
    So long, and thanks for all the fish.

  5. #5
    Join Date
    Feb 2017
    Posts
    4

    Default

    Hi Marabu,

    I've all the parameters needed for Oauth accesses (Consumer key, Consumer secret, Access Token and Access Token Secret) from magento.
    My problem, I think, is how to build / configure the Rest Client or previous step to connect successfully magento.

    Thank you,

    Thomas

  6. #6
    Join Date
    Feb 2017
    Posts
    4

    Default

    Hi,

    I've just used the following example and little customized the JS to generate my request who should include all oauth parameters :
    https://anotherreeshu.wordpress.com/...-using-kettle/

    the rest client request elements looks like :

    oauth realm="",oauth_consumer_key="xxx",oauth_nonce="TGwGuT2NscI",oauth_signature_method="HMAC-SHA1",oauth_timestamp="1487719778",oauth_token="xxx",oauth_version="1.0",oauth_signature="MU6jDtH4xWKKvyKU2ekKYDVGCnM%3D" http://xxx/rest/V1/customers/1

    But I have the following message with 401 error :
    {"message":"Invalid signature"}

    Using Firefox REST client gives a 200 OK answer with same parameters...

    Have someone an idea?

    Thks
    Thomas

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Privacy Policy | Legal Notices | Safe Harbor Privacy Policy

Copyright © 2005 - 2019 Hitachi Vantara Corporation. All Rights Reserved.