Header "securitytenant" not work properly for select tenant

Hi ogallart,

I had the same experience as you! Basically if Kibana(/Opendistro) does not get its headers correctly it will default to the default tenant ( for me it was my private tenant), correct me if I’m wrong.

This is a snippet from my Python code:

url = '/api/saved_objects/index-pattern/' + index_pattern
headers = {
  'kbn-xsrf': 'true',
  'Content-Type': 'application/json',
  'securitytenant': str(role),
  'user-agent': 'create-role.py/0.0.1'
}
data = { "attributes": { "title": index_pattern, "timeFieldName": '@timestamp' } }

If I recall correctly I’m guessing that kbn-xsrf is supposed to be a string and not a boolean, if that does not fix your issue the content-type looks a bit different than mine.

1 Like