Open blauter opened 2 years ago
HI @blauter ,
Not sure but according to documentation it should be:
"PROVIDERSLDAPCONFIG__ROLES_MANAGEMENT__GROUPS_MAPPING=[\"XXX_OPENCTI_Admins:Administrator\", \"XXX_OPENCTI_Users:Default\"]"
Env var for list must be wrapped with global double quotes.
Thank you @richard-julien. I am no longer getting the error but still unable to login
I confirmed I see the XXX_OPENCTI_Admins in the response under memberOf. Just to confirm in the role mapping, I should be using CN name of AD group and not DN? In the memberOf attribute, I see it has DN.
Here are the errors I am seeing right after I see the user object returned in the log.
{"category":"APP","error":{"message":"Restricted access, ask your administrator"},"level":"warn","message":"[AUTH] ldapauth","timestamp":"2022-01-29T00:28:39.588Z","version":"5.1.3"}
{"auth":{"email":"userxx","ip":"x.x.xxx.xxx","referer":"http://xxxxx:8080/dashboard"},"category":"AUDIT","level":"error","message":"LOGIN","resource":{"provider":"ldapauth"},"timestamp":"2022-01-29T00:28:39.588Z","version":"5.1.3"}
{"category":"APP","error":{"data":{"category":"technical","http_status":401},"stacktrace":["AuthFailure: Wrong name or password","at error (/opt/opencti/build/src/config/errors.js:8:10)","at AuthenticationFailure (/opt/opencti/build/src/config/errors.js:13:3)","at AuthDirective.token (/opt/opencti/build/src/resolvers/user.js:117:13)","at runMicrotasks (<anonymous>)","at processTicksAndRejections (node:internal/process/task_queues:96:5)"]},"inner_relation_creation":0,"level":"warn","message":"API Call","operation":"LoginFormMutation","operation_query":"mutation LoginFormMutation($input:UserLoginInput!){token(input:$input)}","size":54,"time":58,"timestamp":"2022-01-29T00:28:39.591Z","type":"WRITE_ERROR","version":"5.1.3"}
Here is line right above.
Hi @blauter, in the code I try to get the information in "_groups" attribute. In your screenshot we can see that the _groups list of the user is empty. Im not an LDAP expert so maybe fetching the groups inside this attribute is not always the thing to do. Please ping me on slack channel to discuss the problem.
After adding role mapping and group base/filter to my ldap config in docker compose file, authentication no longer works.
Here is the error I am seeing which made me think it was something with my PROVIDERSLDAPCONFIG__ROLES_MANAGEMENT__GROUPS_MAPPING environment variable but I am not sure: