Hi all,
I was hoping to store a Username and Password in global variables, set from a sort of Control Panel, and then use them in a HTTP Request Node. But how would I pass a password since it's all hidden with ******
Hi all,
I was hoping to store a Username and Password in global variables, set from a sort of Control Panel, and then use them in a HTTP Request Node. But how would I pass a password since it's all hidden with ******
You can use a function node to prepare the details for the http request node
Depending on the request you want to make you could do something like:
const user ="myuser" // global.get("myuser")
const password = "mypassword" // global.get("mypassword")
const secret = user+":"+password
const hash = Buffer.from(secret).toString('base64')
msg.method ='POST'
msg.url = "https://myurl"
msg.headers = {}
msg.headers['Authorization'] = 'Basic '+ hash
msg.headers['Content-Type'] = 'application/x-www-form-urlencoded'
return msg
and pass this to the http request node (make sure to set the method in the request node to - set by msg.method -
)
new Buffer
is depreciated. Should be using Buffer.from
i stand corrected modified.
Hello,
Could I pass user and password as parameters for Digest Authentication?
Currently my flow works fine with hardcoded credentials in the HTTP Request node and presetting headers for Digest Authentication but I would like to pass user and password as parameters rather than hardcoding them.
Thank you.