Hitachi Vantara Pentaho Community Forums
Results 1 to 9 of 9

Thread: REST Client (Get) with OAuth authentication

  1. #1
    Join Date
    Feb 2014
    Posts
    7

    Default REST Client (Get) with OAuth authentication

    Hi

    Please excuse my inexperience here...

    I am trying to setup a REST Client to get data from a cloud based database using a well defined API. The Host uses OAuth to authenticate access.

    I have a "Consumer Key" / "Consumer Secret" from the Host however I am struggling to see how to configure the REST (Get) transformation

    At the moment, my URL looks like this:
    https://api.xxxxxx.com/xxxx/xxxx/xxxxx/BalanceSheet?access_token=D5C2LxxxxxxxxxxxxxxxxJ15K . The Authentication / SSL / Headers / Parameters tabs are currently empty. On running this, the response is that the "Consumer Key is unrecognised"

    Does the REST Client doesn't allow for OAuth authentication? If so, how do I set it up?

    Any help would be very much appreciated!

    thanks
    Graeme

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

    Default

    This is just reasoning, I never tried:

    The REST Client in Kettle 4.4 is built on HttpClient 3.1 from Apache Commons, which only supports a single authentication scheme: BASIC.
    In order to support OAuth 1.0 you would like to have HttpClient 4.x, but you still would have to prepare the REST Client step for use of this authentication scheme.

    So does the REST Client allow for OAuth authentication - right out of the box?
    No, but you might be able to enhance the existing step or create a prototype using the UDJC step.
    So long, and thanks for all the fish.

  3. #3
    Join Date
    Apr 2008
    Posts
    123

    Default

    Quote Originally Posted by GraemeG View Post
    Hi

    Please excuse my inexperience here...

    I am trying to setup a REST Client to get data from a cloud based database using a well defined API. The Host uses OAuth to authenticate access.

    I have a "Consumer Key" / "Consumer Secret" from the Host however I am struggling to see how to configure the REST (Get) transformation

    At the moment, my URL looks like this:
    https://api.xxxxxx.com/xxxx/xxxx/xxx...xxxxxxxxxxJ15K . The Authentication / SSL / Headers / Parameters tabs are currently empty. On running this, the response is that the "Consumer Key is unrecognised"

    Does the REST Client doesn't allow for OAuth authentication? If so, how do I set it up?

    Any help would be very much appreciated!

    thanks
    Graeme


    I am also trying get the REST Client step to work (PDI 5.01) with a single URL string leaving authentication, ssl, headers, parameters tabs empty, but am not having much luck. Here is the string I am using and a couple of screengrabs that should explain what is going on:

    https://www.eventbriteapi.com/v3/event/123456789?token={YOU_OAUTH_TOKEN}


    With a properly formatted url I am able to get this result back:

    Name:  Image 158.jpg
Views: 2034
Size:  21.4 KB


    But in the REST Client I cannot get it to load any data:

    Name:  Image 161.jpg
Views: 2036
Size:  26.1 KBName:  Image 160.jpg
Views: 2121
Size:  26.4 KB

    TEST: To be sure I had the rest of the transformation correct, I attached the JSON data to a file and used a Txt Input step instead of the REST Client step with success, but I can't figure out why the REST Client step will not return parsable data??
    Perhaps I am having the same issue as GraemeG?
    Not sure how to solve this...any help would be appreciated.
    Last edited by roco; 03-12-2014 at 02:23 AM.

  4. #4

    Default

    Hi All,

    Anyone get RESTclient to work with OAuth?

    Thanks
    Mark
    Regards
    Mark

  5. #5
    Join Date
    Feb 2014
    Posts
    7

    Default

    Hi Mark

    Yes I did get it to work but I did need to write a java library to handle it (which was then used in a modified java step.) Might be easier if you message me directly to chat further?

    Thanks
    Graeme

  6. #6
    Join Date
    May 2013
    Posts
    28

    Default

    Why you didn't post the solution to this problem here?

    I'm stuck on this, and I cannot figure out how to solve it!

    I don't have an url with token incorporated!

  7. #7
    Join Date
    Feb 2014
    Posts
    7

    Default

    The solution I came up with required writing a Java library (*.jar) that contained a function that I then called from a modified javascript step to pass the token with the request. As I needed to do this to connect to xero.com, I am not sure it would work with another cloud api??

  8. #8

    Default A simple document to build sample.kar file would help many, please assist.

    Hi Graeme:

    A simple document to build sample.kar file would help many,

    Really we all stuck in changes that needs to be done on that git.

    please assist.

    Thanks,
    Sivasakthi

    Quote Originally Posted by GraemeG View Post
    The solution I came up with required writing a Java library (*.jar) that contained a function that I then called from a modified javascript step to pass the token with the request. As I needed to do this to connect to xero.com, I am not sure it would work with another cloud api??

  9. #9
    Join Date
    Aug 2016
    Posts
    290

    Default

    Are you talking about building a sample.jar file? Cause that is already heavily documented on the internet and definitly out of scope for this forum! I would guess compiling a jar is part of the essential programming 101 for most computer engineer educations.

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.