Topic on Extension talk:LDAPAuthentication2

Jump to navigation Jump to search

LDAPSearch: Custom Filter, Result Search and List of mapping fields

2
Guims08 (talkcontribs)

MW. 1.34.1

PHP. 7.2.18

LDAPAuthentication2. 1.0.1

LDAPProvider 1.0.3

PluggableAuth. 5.7

extensions/LDAPProvider/src/PlatformFunctionWrapper.php


Hello every one, I do not know if it is the right place, because I have no bug but a request for advice.

I recently upgrade my MW, installed LDAPAuthentication2 and use it with Sun Directory Server Enterprise Edition 7.

Everything works fine.


But when I look at the logs (/var/www/mediawiki/debug.log). I note that the search filter is not optimal, that the search result returns me all the LDAP attributes of the user (which is useless).

It seems that the LDAP search function is in the file "extensions/LDAPProvider/src/PlatformFunctionWrapper.php " but i don't know how to "custom" it, it's frustrating.

I think we should modify this request [ldap_search( $linkID, $baseDN = 'dc=mycompagny,dc=country,dc=glob', $filter = '(uid=guims08)', $attributes = [ '*', 'memberof' ], $attrsonly = , $sizelimit = , $timelimit = , $deref =  );]

but maybe it's not here.


Anyone know where can I custom filter and search results ?

Last point: Where i can find a list of Mappings Data ?


If anyone can answer my questions.


Thank you very much

Osnard (talkcontribs)

Hi!

Thanks for your request!

  • Q: Anyone know where can I custom filter and search results?
    • At the moment there is no good way to do it. You will probably need to hack UserInfoRequest.php . If you explain your motivation of changing the filtering, maybe I can implement something that suits your needs.
  • Q: Where i can find a list of Mappings Data ?
    • Unfortunately I don't understand completely. "LDAPAuthentication2" will only sync "username", "realname" and "email". If you need further syncing you will probably need Extension:LDAPUserInfo. This allows you to map whatever field is available in the "UserInfoRequest"-reponse to a MediaWiki user property. You can also specify a callback function that allows additional processing of user info data.
Reply to "LDAPSearch: Custom Filter, Result Search and List of mapping fields"