It seems every bit of documentation that I read has conflicting advice, and I'm stumped on this one. First of, I've never worked with OIDC or SAML before so this is my first exploration.
I'm trying to configure SSO so it will pull the "groups" from the user logged in, and map the correct role to the user.
This is the current elasticsearch config (although lots have been removed so you can see what I've done)
xpack:
security:
authc:
realms:
oidc:
oidc1:
order: 2
rp.client_id: "0000000000-0000-0000-0000-0000000000ETC"
rp.response_type: "code"
rp.requested_scopes: ["openid", "email"]
rp.redirect_uri: "https://elasticsearch-cloud-instance/api/security/v1/oidc"
op.issuer: "https://login.microsoftonline.com/tenant_id/v2.0"
op.authorization_endpoint: "https://login.microsoftonline.com/tenant_id/oauth2/v2.0/authorize"
op.token_endpoint: "https://login.microsoftonline.com/tenant_id/oauth2/v2.0/token"
op.userinfo_endpoint: "https://graph.microsoft.com/oidc/userinfo"
op.endsession_endpoint: "https://login.microsoftonline.com/tenant_id/oauth2/v2.0/logout"
rp.post_logout_redirect_uri: "https://elasticsearch-cloud-instance/logged_out"
op.jwkset_path: "https://login.microsoftonline.com/tenant_id/discovery/v2.0/keys"
claims.principal: email
claim_patterns.principal: "^([^@]+)@mydomain\\.com$"
I've also tried changing the claims.principal, removing claim_patterns to this after reading some mixed reports.. but no luck!
claims.principal: sub
claims.groups: ".*"
So I have the following role mapping created in Kibana:
PUT /_security/role_mapping/oidc-kibana
{
"roles": [ "kibana_user" ],
"enabled": true,
"rules": {
"field": { "realm.name": "oidc1" }
"field": { "groups": "2192a737-0000-48c4-0000-d93baa330c48" }
}
}
The above does not work, however when I take our "groups" in the role mapping then it does work successfully, so that tells me that the other bits I've configured correctly and it's just somehow not seeing the groups...
Using some other tools, I've managed to get the JWT and decode it, I can see that the "groups" attribute is actually being populated as shown however I have removed some bits after the groups..
{
"typ": "JWT",
"alg": "RS256",
"kid": "removed"
}.{
"aud": "removed",
"iss": "https://login.microsoftonline.com/removed/v2.0",
"iat": numbers,
"nbf": numbers,
"exp": numbers,
"groups": [
"2192a737-0000-48c4-0000-d93baa330c48",
"8e4742de-0000-4248-0000-b1a13ab1d822"
],
}.[Signature]
All of the documentation sends me round in circles to other documents, that are not consistent to the first or have different examples and don't quite explain it simply enough..
Does anyone have any clear examples on how I could get this working? I want to split say readers and admins out by their groupid's from our IdP.
Thanks for any help
O.