Hey Igor,
You're right, working with authorization in Pentaho Data Integration can be a bit tricky, but you're absolutely on the right track. Instead of working with authorization directly on the Header tab, try a different approach.
In the REST Client step, go to the 'HTTP Options' tab. You'll find a field called 'HTTP Header Name', set that to 'Authorization', and in the 'HTTP Header Value', put 'Bearer ${Authorization}'. This way, you're explicitly telling Pentaho to include 'Authorization' in the header with the Bearer token.
I've faced a similar challenge before, and this setup worked for me. Sometimes tools like Postman abstract these details, but Pentaho gives you more control.
Give it a shot, and let me know.
------------------------------
Valeri Bakop
Others
Freelance
------------------------------
Original Message:
Sent: 02-14-2023 14:37
From: Igor Martins
Subject: Rest Client – How to setup an Authorization Bearer in the REST Client?
Hi Guys, I need to consume an API that in the header I need to pass the Authorization that is a bearer? How can I do that?
In my test, before the Rest Client step I put a Generate Rows with 2 fields:
URL: my endpopint
Authorization: with the value Bearer {my_token}
In the job properties I also create a parameter called Authorization with the same value
Now, in the REST Client step, in the Header tab in the filed I selected Authorization and in the Name I set ${Authorization}.
After that, I executed he transformations but the answer was that the Authorization is incorrect.
Just to check if my token was valid, I made test using postman, and it works properly. The difference is that in the postman there is a tab that I can choose the type, in my case Bearer Token and then I put the token. I the header I didn't need to put nothing.
So, how can I do it in Pentaho Data Integration?
Regards, Igor Martins
------------------------------
Igor Martins
Director of Sales
Particular
------------------------------