jelhub / scimgateway

Using SCIM protocol as a gateway for user provisioning to other endpoints
MIT License
176 stars 57 forks source link

HTTP Get for LDAP Plugin Quite Slow #84

Closed edgars closed 1 year ago

edgars commented 1 year ago

Hi there,

Is there any configuration that we could do to improve the /Users response time, actually I am using a ldiff that comes as an example in CA Directory, in my userBase ("userBase": "ou=Information,ou=Corporate,o=DEMOCORP,dc=example,dc=org",) I have just 37 users and it's taking over 19 s to respond, is there any trick to improve it?

When I access via JXPlorer, the same openLDAP is super fast,

Thanks for any help,

jelhub commented 1 year ago

Hi, Do your directory support groups, and do your plugin have groups configured like groupBase and "mapTo": "groups.value"?

If not, current version will try lookup user groups even though not configured.

You could try what mention below to fix this

Comment out https://github.com/jelhub/scimgateway/blob/master/lib/plugin-ldap.js#L264 and add following:

const scimObj = scimgateway.endpointMapper('inbound', user, config.map.user)[0]
if (!scimObj.groups) scimObj.groups = []
return scimObj

Change https://github.com/jelhub/scimgateway/blob/master/lib/plugin-ldap.js#L512 to:

if (!config.map.group || !config.entity[baseEntity].ldap.groupBase) { // not using groups

Regards, Jarle

edgars commented 1 year ago

Hi there,

Hi, Do your directory support groups, and do your plugin have groups configured like groupBase and "mapTo": "groups.value"?

If not, current version will try lookup user groups even though not configured.

You could try what mention below to fix this

Comment out https://github.com/jelhub/scimgateway/blob/master/lib/plugin-ldap.js#L264 and add following:

const scimObj = scimgateway.endpointMapper('inbound', user, config.map.user)[0]
if (!scimObj.groups) scimObj.groups = []
return scimObj

Just fixing that part that already worked from 19s. I got the response in 700ms, quite an impressive improvement, I believe that the group mapping was the issue.

thanks.

Cheers

Edgar