How to fetch certain social network profile information (Drupal 8)?

Hi,

I want to use a few of the social network profile information in the user profile of Drupal 8. Up to now I only get the image and the name.
As far as I understand I can use the Rules module to do this in Drupal 7 by using the event "Oneall registered user". But in Drupal 8 I am not able to find this, so I suppose this is not implemented in the Drupal 8 "OneAll Social Login" module already.
What options do I have?

Thanks..

Best Answer

  • Hi Sven,

    Rules unfortunately had no Drupal 8 module when we created the plugin, so currently the plugin does not support it.

    What you can do is edit this file:
    modules/social-login/src/Controller/SocialLoginCore.php

    Then look for this block:
    // Create a new user. $account = User::create($user_fields); $account->save();

    You could save your custom fields after this block. The data is available from the $identity variable.

    Regards,

Answers

  • I got it working. Thanks a lot!
  • Thank you for the update! I'm glad to hear that it works now!
  • Hi!

    It's good to see that the support team is doing a great job answering queries.

    I was just wondering if the field mapping can be done via some api hooks rather than 'hacking' the module. It's kind of a huge no-no to alter or customise contrib module code.

    This can probably also be done via a local patch but then again I can see it as a common concern.

    It's a feature request rather than a technical question so I'm grateful for any response. :)

    Thanks!

  • Hello,

    for Drupal 7 we have hooked by with the Rules module
    As soon as there is a stable version of Rules for Drupal 8, we will integrate it too.

    Regards,

Sign In or Register to comment.