2

I have to authenticate users against a remote authentication API. In the API's response there are several user properties, some of them mappable to a Drupal User some of them not.

Because of legal constraints I don't want to store the users' data in the Drupal DB. I need "free floating" users. I checked some modules (externalauth, ldap), and as far as I understand every module does in fact use the DB to store user data.

I'd very much like to write an AuthenticationProvider that returns an entity which exists just for this single request. But I have a feeling that this approach is way too simple.

What would be the correct way of doing this (if it is actually possible)?

2
  • Probably not the best worded question "correct way". There are still multiple ways of doing this such as swapping entity storage handlers. I don't know if this question will get good answers.
    – mradcliffe
    Commented Apr 5, 2017 at 11:39
  • Hard to say, theoretically yes, but you will likely run into quite a bit of code that assumes that the id is a user entity ID and will attempt to load that to e.g. access additional data.
    – Berdir
    Commented Apr 5, 2017 at 19:43

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.