EDD Social Login takes a few steps during its login process to keep your customer accounts in sync with social accounts. It's helpful to know what steps it takes to link and create customer accounts to understand where certain issues can arise.
Here are the steps EDD Social Login takes to link or create customer accounts on your site:
First, EDD Social Login will try to identify customer based on the social identifier. This is basically a check to see if this social account has been used on the site before.
If a user has already linked this social account to their account on your site, this step will successfully log them in. This primary check lets your users unlink accounts, then re-link them to the existing WordPress user account to maintain their history on your site.
For example, a customer could unlink a Facebook account from your site, then try to log in with that Facebook account at a later date. Instead of creating a new account, this will re-link Facebook to the existing account since they have been linked in the past. This does not work with Twitter or Instagram (see details below).
If a user account is not found in step 1, this means that the social profile has not been used before, EDD Social Login will then try to search for the user via the email address provided by the social profile to see if the customer already has an account on your site.
If the user is using the same email address for both the shop account and the social profile, this step with automatically link their social profile with their WordPress user account and successfully log the user in.
Note that Twitter and Instagram are exceptions, as they do not provide an email address.
Without an email address, EDD Social Login will not be able to successfully look up a preexisting account.
Note that site accounts that use another role (aside from customer) will not work this way for security. See below.
If a user is already logged into your site when they try to link an account, EDD Social Login will do a couple more checks:
You should be aware that Twitter and Instagram don't return an email address when the user logs in, so their WordPress account isn't tied to an email (just a username). While we can reasonably assume an email gives us a unique person, we can't make that assumption about a username, as the user can just enter whatever they want for a username on these networks.
This means that unlinking an account from Twitter or Instagram and then trying to log back in again will not link to the previous account. Instead, we create a new account for security to ensure we don't link two different people's accounts since we have no email address to work from.
If a customer has an account on your site, and "logs in" with a social account that uses the same email address, they will be linked automatically and the customer will sign into his / her site account.
Other user accounts, such as admin or shop manager accounts, will not allow automatic linking of a social network by email address if you're logged out. This is by design for security. Some of the newer networks we've added (or ones we may add in the future) may not validate email addresses before allowing a social sign in, so we need to protect your website from someone spoofing your account to gain access. Here's an example:
There's a very low risk of this happening, as you'd have to have a specific set of conditions for this to occur:
Even though this is low risk, we can't allow automatic linking for accounts with this level of site permission, so this will never work for your own account as a site administrator (unless you choose to filter which roles allow automatic linking at your own risk). You must log in and then link new accounts (whether they use the same email or not) via "My Account" for any account that has site permissions greater than a customer.
With that said, remember your customers can automatically link by email address since they have low permissions with the "customer" role, and there's extremely low risk in allowing this behavior (we're trying to balance risk with convenience for your customers).