I have a problem that I can't figure out and hope someone here can shed some light on.
In my flows I use an http request node to login to a service which returns a (very long) bearer token called idToken
.
I then pass that to a function node which sets the headers like:
var idToken = msg.payload.idToken
msg = {}
msg.payload = {}
msg.headers = {};
msg.headers['Authorization'] = "Bearer " + idToken;
I then pass this to a get request in a new http request node (which has Use authentication
unchecked).
This does not work (returning 401 unauthorized) But... If I copy the idToken from debug output, check the Use authentication
tickbox, select Bearer and paste in the token manually the request works fine.
This is not a solution since the token times out after around twenty minutes.
The question is what could the built in bearer authentication be doing that my 'headers' are not, and/or is it possible to pass the token using mustache format or similar rather than in the headers.
For what it is worth this is a (now timed out) bearer token interesting for being long if nothing else:
eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6Im5pcGVnZWdpQHJvdW5kYnJpdGFpbiIsIm5hbWUiOiJOaXBlZ2lnaSBSb3VuZCBCcml0YWluIiwicm9sZSI6InVzZXIiLCJzY29wZXMiOltdLCJpc3MiOiJodHRwczovL2FwaS5pcmlzLmxyLm9yZyIsInN1YiI6Im5pcGVnZWdpQHJvdW5kYnJpdGFpbiIsImlhdCI6MTU2MTAxNjcxOCwiZXhwIjoxNTYxMDIwMzE4fQ.tbNFf5I_C4-xSePEL_EDDfmJ0br1z0NplwBtnDwIScxGWUYYY0-qSN2VUvyKXzIAGSmVkroix6KTMIMa8mToclteR6dKq8PkEvBorXAkDq84dL2peUhHUilVNY3Sc-bH3Er59OGdW7R_dbwzYSzryJShCP0mMVWhB3Y7NccWVJGZ7LAL4pY50uTDBm8LU-CrRLfoAmkumtGqdwQrc0bBkYEHrMdjVjNlRjzazRlzT0KWlafgWFJ71n8ZY-18wI4cJeGnv9flfuBfL_KfTPWU5cYe_zqCKtTodTJWfdFOLmx1QM6tpqksxEGucfUvUIzkMFhym1MGqIloL8ejb1cu7TBaInMZgVJFcl6gSxu2Z6MJaoo4zgoAN3QhwztxjOOATL5LnOo9htfCOvymEBdNW9lAizjmregnXpjIm6CsrmhS7IUH3FEwSQMdBaZB0_H3NfwBfOMedRDWsoSyDu7YlOqf86dUOVGOe7XABGX3HZpDYnwfsWaSbImPsdLshoKsWyydYiMXcpSx2SW_22YmyzqkM_5afaD-g-ey0fkGF4cFDc_QB47I2I3XXtmggz3JCldDWV5b5nyjucMcPLSTGpfufFpVHi8r_WHpyPoBT4l0znNvq_5zZb3J5nCz73j7fG9Y1tB1bgQuTkLkZpiiSYrQbfrrXbz1ajga_kjWJJ0
Thanks