How to pass Authorization Token in Header Angular JS
i think you've switched the position of the payload and the header
should be
http.post(url, data, config)
instead of http.post(url, config, data)
link to doc
I'd recommend to put all the logic inside an http interceptor, so the auth header will be appended to each request.