Maybe you have some ideas for that case?
I also tried and searched to create a expression to enter the credentials from a saved credential set, which was not possible.
Hi @prononext, is the server you’re connecting to using OAuth2 by any chance?
If so, n8n can usually manage the token renewal for you. It also supports sending the credentials in the body if you select Body in the Authentication dropdown of your OAuth2 credentials:
I think in this case your best bet might be to save your secret in an external data store (such as a database) and read it in your workflows whenever needed.
You could also consider using an environment variable which you can read inside n8n through an expression such as {{ $env["MY_VARIABLE_NAME"] }}.
I have the exact same problem. And even though I think it should be easy to solve, there is something I am missing.
I am using n8n cloud solution.
I don`t know how to save environment variable - should i use ssh node? how do i authenticate?
I have also tried to save the credential to a file, but I got a permission denied when I`ve tried that. What path should i use that i have permission to save a file?
@MutedJam I`ve found no documentation about the n8n cloud installation. Could you point me to a solution please?
I need to “save” the credential so i can use it until expires. If i just “set” the value it will be lost in the next run, right?
Let me be clear. I have to make an initial authentication sending my username and password in the body of an http request, just like the initial message in this thread. The server respond to me with a bearer token authentication. I will be using this token until expires, than i have to ask for another.
I have to save this token I’ve received to be used for many runs of the workflow.
Did you find a solution?
I have the exact same scenario in that I have to authenticate at the body with a user/password in order to get a Bearer Token that expires after 5mins. My main concern is that I don’t want to store the password in plain text.
Are there any options for us n8n self-hosted? or must we upgrade to paid plans that offer ‘Global Variables’ (Pro Plan) or ‘External Secret Integration’ (Enterprise Plan).