Replace the `ldap_user_identities` table with the authmap (or whatever) table from External Authentication module and make it a dependency.
https://www.drupal.org/project/externalauth
@svendecabooter
queenvictoria: simplesamlphp_auth/src/Service/SimplesamlphpDrupalAuth.php adds the externalauth service, which could be useful as an example
@svendecabooter
The module came about when porting the https://www.drupal.org/project/simplesamlphp_auth module to Drupal 8.
It's an attempt to create a generic solution for the problems that were solved in Drupal 7 core with regards to external login.
It would indeed be interesting to see if the module can be used for the LDAP module in Drupal 8.
The outcome of the conversation is that externalauth pretty much just provides the authmap table that was removed from core in D8. It provides other bits and pieces. @svendecabooter is happy to receive patches for other functionality. I will rework ldap_authenication to use externalauth where possible (at least the authmap table).
Then we can move the Views issue into External Authentication's queue
https://github.com/Laudanum/ldap/pull/32
| Comment | File | Size | Author |
|---|---|---|---|
| #22 | implement_externalauth-2698157-22.patch | 648 bytes | thtas |
| #16 | implement_externalauth-2698157-16.patch | 2.42 KB | grahl |
| #14 | implement_externalauth-2698157-14.patch | 639 bytes | grahl |
| #9 | ldap_user-externalauth-2698157-9.patch | 6.55 KB | queenvictoria |
Comments
Comment #2
queenvictoria commentedComment #3
queenvictoria commentedComment #4
queenvictoria commentedComment #5
queenvictoria commentedComment #6
queenvictoria commentedAs this is a reasonable change please review it.
* Run update.php. Notice that the ldap_user_identities table disappears and authmap is populated with the data from the ldap_user_identities table.
* You should still be able to authenticate (and create a new user by so doing) which will create a row in the authmap table.
Comment #7
queenvictoria commentedComment #8
larowlanSome minor remarks/comments - happy for all of these to be follow up tasks
We should wrap this in
t()We should do that here too.
Should we do this in a batch (using the passed $sandbox argument) in case there are some sites with 1000s of users?
I think we should do this in a separate update hook, just for clean separation - this is something @andypost taught me.
Comment #9
queenvictoria commentedThanks for the feedback and fixes. I've updated the patch please take a look!
Comment #10
grahlThere is at least one functional error in patch #9 in ldap_user_get_identifier_from_map(), where $authname is declared but $authmap used.
Comment #11
larowlanThis looks wrong
Comment #12
queenvictoria commentedGood catch @grahl. Committed in 7f13ffe9798125a067f21b3dfd55a31d8d965062
Comment #14
grahlSorry to reopen this but I think something obvious is still missing: ldap_user should have externalauth as a dependency so that this gets enabled automatically. The trivial patch for that is attached.
Comment #15
grahlAdditional patch needed since ldap_user_get_identifier_from_map() still gets called with uid instead of id().
Comment #16
grahlSorry, one more update but ldap_user_get_identifier_from_map() was calling its service incorrectly. Weird since all other functions did it correctly.
Comment #18
larowlanthanks
Comment #20
DarcyB commentedIt looks like Provisioning Drupal accounts from LDAP is not functioning. A browse of the source makes me think this might be intentional, or at least somewhat known. Is there a plan/timeline for enabling this ?
Comment #21
DarcyB commentedComment #22
thtas commentedldap_user_get_identifier_from_map is not properly returning the authname.
see patch
Comment #23
larowlanLGTM
Comment #31
queenvictoria commentedCommitted thanks!