1 min readSep 5, 2019
This is how I would add a header dynamically to a given HTTP request:
let myHeaders = new HttpHeaders();
myHeaders = myHeaders.append('Authorization', 'Basic ' + yourToken);http.get(url, { headers: myHeaders }).pipe(....);
Not really adding it to the proxy config (not possible to add things dynamically there) but the header will go through. How you fetch the token depends on your system and setup.