Hi,
The module works well when creating a new account (Although I still have this issue https://www.drupal.org/project/social_login/issues/2923781).
I've used the module to login with facebook. When I visit my user page I can see the social media icons at the bottom. I'm given the impression that I can add other social media accounts into my drupal account.
I have the same email When I click on the linkedin icon, It proceeds with the login process in the popop and I'm redirected back to my user page. When I scroll to the bottom, there's no check on the linkedin icon, even if I refresh.
I added some logging to check the response message on line 77 in SocialLoginCore.php
ob_start();
var_dump($data);
$out_put_log = ob_get_clean();
\Drupal::logger('testing')->notice($out_put_log);
This gave me:
/vagrant/web/modules/contrib/social_login/src/Controller/SocialLoginCore.php:78:
array (size=2)
'http_code' => int 400
'http_data' => string '@"response":{"request":{"date":"Wed, 06 Jun 2018 04:56:58 +0200","resource":"\/connections\/a8077f5c-5e8e-4c94-b2c3-1a20460c946f.json","status":{"flag":"error","code":400,"info":"Your request could not be processed due to an error"},"result":@"status":{"flag":"error","code":400,"info":"The identity could not be linked","data":{"action":"associate_identity","plugin":{"key":"social_link","data":{"action":"link_identity","operation":"nothing_to_do","reason":"identity_is_linked_to_another_user","status":"erro'... (length=3852)
When I click on the twitter icon (twitter account uses a different email), the same thing happens - I get the 'You have logged in withtwitter' and redirected back to the user page. But I get the same output with my debug code.
Any help would be appreciated.
Comments
Comment #2
japo32 commentedComment #3
karuna patel commentedHi @japo32
Your requirement is for login through social media accounts and also register using the same ?
If that so I will recommend you to use Hybrid Auth module
I have used this module and it works perfectly for login and register accounts.
Thanks
Comment #4
ClaudeSchlesser commentedHi @japo32,
please have a look at the new version (8.x-2.8).
https://www.drupal.org/project/social_login/releases
We have added a specific error message for this case:
Best Regards,
Comment #5
japo32 commentedThanks for the update ClaudeSchlesser. I'll check it now. Also, it would be helpful to update the recommended version of the project. Composer is still picking up 2.72 automatically.
Comment #6
japo32 commented@karuna,
Thanks for the suggestion but I need a D8 solution. :)
Comment #7
japo32 commentedThe error message is definitely useful, Thanks!
'This social network account is already linked to another user. First logout and then login with that social network account.'
Are there plans to support multiple social network accounts in one drupal account?
Comment #8
ClaudeSchlesser commentedThis is already possible. Simply login and go to your profile settings. There you can unlink/link social networks.
To fix the error that you have:
Comment #9
japo32 commentedThanks for the quick responses ClaudeSchlesser, I really appreciate it.
So here's what I did:
- [admin] delete the account.
- Went back to /user and clicked the facebook icon to login.
- popup appeared and closed, nothing happened.
- clicked on the facebook icon again, popup appeared, I get the redirect message and sent to the Create new account form.
- I click the button to create the account.
- I get the 'A welcome message with further instructions has been sent to your email address.' message
- [admin] I set a password for the new account.
- I go back to /user and click on the fb icon again. popup appeared, I get the redirect message and get logged in.
- I click Edit.
- I click the linkedin icon.I get the popup, popup closes and nothing happens on the main window.
- I click the linkedin icon again, I get the 'Logging you in' redirect page and then I land back on the user edit page.
- The linkedin icon still has no check. I try it again a couple of times same result.
- I click the facebook icon and I get the modal popup 'Link/Unlink your Facebook accounts'
- on the modal box the 'Add another account' section only has connect with facebook.
- I click on 'Unlink Account' and I get a popup asking for facebook password validation.
- I submit my password and I'm back on the main window with the modal popup. The facebook account is still there.
- I try it again (it asks for validation again), and I get the same result.
- I close the modal box and refresh the page F5.
- And now the facebook icon has no check as expected.
- I click on the facebook icon to link the account. I get the popup but the main window doesn't change.
- I refresh and the check is there on the facebook icon.
I am able to create an account from scratch using linkedin but it takes a few tries to actually get the redirect message.
I have had success linking a facebook account with a drupal account created with linkedin.
I've found that logging in works better if I don't do consecutive tries and leave it for a few seconds before trying again but that may just be coincidence.
-----
And while writing this I've been testing it out and it seems like there may have been issues with the accounts I've made before. I say this because I've disassociated the social media accounts that I linked last time before deleting the drupal account and recreating. And it looks to work more consistently now.
It does still have the issue of having to try logging in multiple times and when trying to add a new account sometimes the page doesn't refresh to show the check. I found what worked for the multiple logging was to count 7 seconds before trying again.
Comment #10
ClaudeSchlesser commented