SAML group mapping

I am trying to map groups from my IDP. I can see in the SAML attributes that the group is provided see the json bellow

<saml2p:Response Destination=""
    <saml2:Issuer xmlns:saml2="urn:oasis:names:tc:SAML:2.0:assertion"></saml2:Issuer>
        <saml2p:StatusCode Value="urn:oasis:names:tc:SAML:2.0:status:Success" />
    <saml2:Assertion ID="Assertion_f246e08f4bc497ecbf3d005f126c312d1770778c"
        <ds:Signature xmlns:ds="">
                <ds:CanonicalizationMethod Algorithm="" />
                <ds:SignatureMethod Algorithm="" />
                <ds:Reference URI="#Assertion_f246e08f4bc497ecbf3d005f126c312d1770778c">
                        <ds:Transform Algorithm="" />
                        <ds:Transform Algorithm="">
                            <ec:InclusiveNamespaces PrefixList="xs"
                    <ds:DigestMethod Algorithm="" />
            <saml2:NameID Format="urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified">pera01</saml2:NameID>
            <saml2:SubjectConfirmation Method="urn:oasis:names:tc:SAML:2.0:cm:bearer">
                <saml2:SubjectConfirmationData NotOnOrAfter="2020-03-26T08:03:04.381Z"
        <saml2:Conditions NotBefore="2020-03-26T08:02:54.379Z"
        <saml2:AuthnStatement AuthnInstant="2020-03-26T08:02:54.379Z">
            <saml2:Attribute Name="Username">
                <saml2:AttributeValue xmlns:xsi=""
            <saml2:Attribute Name="groups">
                <saml2:AttributeValue xmlns:xsi=""

In my elastic config :

order: 2
attributes.principal: "nameid"
attributes.groups: "groups"

I added the mapping from the API :

"enabled": true,
"roles": [ " superuser" ],
"rules": { "all": [
{ "field": { "": "samlint" } },
{ "field": { "groups": "CN=udspzzzp01_role_platform,OU=roles" } }
] }

What am I missing ?

Thanks a lot

Please don't post images of text as they are hard to read, may not display correctly for everyone, and are not searchable.

Instead, paste the text and format it with </> icon or pairs of triple backticks (```), and check the preview window to make sure it's properly formatted before posting it. This makes it more likely that your question will receive a useful answer.

It would be great if you could update your post to solve this.

It depends. What are you trying to do ? What do you expect to happen ? What happens instead ?

I tried to map the member of the group "CN=udspzzzp01_role_platform,OU=roles" with the role superuser.
The users are able to connect but I am not allowed to check the users/roles from the kibana GUI.

superuser is an elasticsearch role. You also need to give your users a role that gives them access to the Kibana interface, try kibana-admin ( see here for more details )

I'd like to stress out that it is strongly suggested that you create the roles that give access to your users to exactly the data in elasticsearch and the features in kibana that you need and do not rely on coarse-grained built-in users such as superuser and kibana-admin as these allow far more things than your users need.

Thanks, I agree. The thing is at first I want to see that the mapping actually works. And then I'll actually focus on the "real" rights

Ok I got it figured out.

I had more than one mapping. Removing them all and just adding the one with the group solved it.

Is there a way to have a mapping for all users that don't match a group to have default access ?


This is a role engineering problem not a SAML or elasticsearch specific one I would say. I would go about creating 2 roles :

  • A base one that gives your users "default access" , mind you have to define what "default access" is for your case, there is no such concept in the Elastic Stack
  • A more privileged one to give the members of the group.

Then create two role mappings , one to give all that login via SAML ( only a { "field": { "": "samlint" } }, rule that is ) the base role, and one such the one you already have ( if they login via saml and are in the group to get the more privileged role )

It is all good, it all works as expected. Thanks a lot

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.