Create user with opendistro_security_roles - not creating any rolemapping

I am using OpenDistro 1.11.0.
When creating a user using REST api, it works when mapping the user to an existing role ‘exporter_role’ I’ve created previously:

PUT https://{{esHost}}:{{esPort}}/_opendistro/_security/api/internalusers/exporter_test
  "password": "******",
  "opendistro_security_roles" : [ "exporter_role" ]

I tested, and user indeed has access by the permissions of the ‘exporter_role’.

  1. Why this API doesn’t create any rolemapping entity? Also, in Kibana, this mapping is not shown because the lack of rolemapping.
    Is this a bug?

  2. I can also add the rolemapping by API, and then it is shown in Kibana. But I am not sure if it is really needed or not.

PUT https://{{esHost}}:{{esPort}}/_opendistro/_security/api/rolesmapping/exporter_role
  "users" : ["exporter_test" ]

Thank you,

Hi @orid
If you are creating user via API, the security_role is passed in attributes, therefore there is no exclusive mapping showing up in the UI.
If you want the mapping to show up in UI you will need to create it manually via API or configuration files. But there is no added benefit except the UI element.

Thanks for the clarification, @Anthony / @pablo .