How to use credentials in the request header of a REST GET

I have a bearer token for using services of an external party. When I provide this token hardcoded in the request header like below it works like sunshine (for GET, POST en DELETE requests).

afbeelding

But I would like to include this token via something as a Credentials Configuration node, but I cannot get this working. I cannot add this string "Bearer " in front of the token, and if I add it to the password to avoid this issue, the credentials flow variable cannot be defined as header value.

I found this post in which a similar “bonus question” was asked by @LoicCR : I can't use Flow variables as Credentials in Get Request nodes - #10
Unfortunately it was not answered back then (in the same thread).

Is there a way to avoid hardcoding this token?

For completeness: I’m using KNIME 4.7.7 on Windows

Hi,
Under ticket AP-20257 we have a request for this already for our developers. In the ticket, the idea is to allow the user to set a prefix for credentials passwords in the header, so that the token can be prefixed with “Bearer”. Our developers have commented there that maybe instead of that, we will introduce a new port type to hold authentication info, such as a token. In that case there’d be a node to create a token port and that could then be passed to the GET Request node. However, as of now neither option seems to be implemented. I have asked our devs for an update.
Kind regards,
Alexander

1 Like

Hi @AlexanderFillbrunn,

Thanks for the feedback. Saves me from trying the impossible.

I hope it will be fixed some day (soon?). And if it enforces me to update to a new version of KNIME I have another good reason to do so :slight_smile:

1 Like