We have a file *.key which has the raw secret key. We need to read the sting and pass it as Auth Token to the Http Node call.
We could not read the file content. We used ‘Read/Write Files from Disk’, but it gives only the file metadata, not the raw content.
Any way to achieve this scenario?
What is the error message (if any)?
Please share your workflow
(Select the nodes on your canvas and use the keyboard shortcuts CMD+C/CTRL+C and CMD+V/CTRL+V to copy and paste the workflow.)
Hi @shakthipsg! You can use the Read/Write File node which you can enable from the docker settings
To load your .key file then pass its binary output to the extract from file node, to get the raw string which you can directly use in HTTP node as a Auth token
The Read/Write Files from Disk node outputs the file as binary data so you won’t see the actual content in the JSON output, it’s under the Binary tab. After that node just add an “Extract From File” node and set the operation to “Extract From Text File”, that’ll convert the binary into a plain string you can reference in your HTTP Request node’s auth header with an expression like {{ $json.data }}.
Yeah the Read/Write Files from Disk node only gives you binary data, you need to convert it. Easiest way is to add a Code node right after it with something like:
@shakthipsg Now attach an Extract from File here, and then read your key using common json.data and then pass that key to HTTP node where you want it to be.
Hi @shakthipsg !
we’re glad to hear that! please consider marking the most appropriate answer to your question as the solution. This helps the community and the supporters.