I want to intercept all http request from kibana and add jwtHeader in each of them. I tried writing a plugin in which I'm using $httpProvider.interceptors to intercept and add headers.
uiModules
.get('kibana', ['angular-jwt'])
.config(['$httpProvider', 'jwtOptionsProvider', function Authenticate($httpProvider, jwtOptionsProvider) {
var refreshPromise;
jwtOptionsProvider.config({
tokenGetter: ['$q', '$timeout', 'jwtHelper', function ($q, $timeout, jwtHelper) {
// setting authentication header
});
$httpProvider.defaults.withCredentials = true;
$httpProvider.interceptors.push('jwtInterceptor');
}]);
But this seems to be called only when I go to this plugin page and also this interception only works on this plugin page only. If I go back to suppose Discover page then interceptor doesn't add any headers.
So how can I intercept all request going from kibana so I can add authentication headers? I've seen #19060 but is it possible to do in kibana v6.3.2?