Hi,
I'm trying to authenticate to Kibana using an IDP and SAML.
The version of Elasticsearch used is 7.2.0.
Starting from an application I try to authenticate myself on Kibana. The problem is that I haven't found much documentation and I currently receive the error .....
this is a section of saml on my elasticsearch.yml:
xpack.security.authc.token.enabled: true
xpack.security.authc.realms:
saml:
saml1:
order: 2
idp.metadata.path: saml/b-idp-metadata.xml
idp.entity_id: "https://xxx/idp"
sp.entity_id: "https://yyy:5601/sp/"
sp.acs: "https://yyy:5601/api/security/v1/saml"
attributes.principal: "nameid:persistent"
nameid_format: "urn:oasis:names:tc:SAML:2.0:nameid-format:unspecified"
this is a section of salm on my kibana.yml:
xpack.security.authProviders: [saml]
xpack.security.sessionTimeout: 1
server.xsrf.whitelist: [/api/security/v1/saml]
this is a section of attributes on identity provider:
ClaimsIdentity ci = new ClaimsIdentity();
ci.AddClaim(new Claim(ClaimTypes.NameIdentifier, subject)); // Subject -> NameID
ci.AddClaim(new Claim("principal", "nameid:persistent", ClaimValueTypes.String)); // AttributeStatement -> Attribute
response.NameId = new Saml2NameIdentifier(ci.Claims.Where(c => c.Type == ClaimTypes.NameIdentifier).Select(c => c.Value).Single(), NameIdentifierFormats.Transient);
response.ClaimsIdentity = ci;
this is the mapping that i configured:
PUT /_security/role_mapping/saml-kibana
{
"roles": [ "myrole" ],
"enabled": true,
"rules": { "all": [
{ "field": { "realm.name": "saml1" } }
] }
}
this is the message that i receive:
statusCode | 401 |
---|---|
error | "Unauthorized" |
message | "[security_exception] unable to authenticate user [] for action [cluster:admin/xpack/security/saml/authenticate], with { header={ WWW-Authenticate={ 0="Bearer realm=\"security\"" & 1="ApiKey" & 2="Basic realm=\"security\" charset=\"UTF-8\"" } } }" |
Can anyone help me?
thanks,
Giorgio