Django allauth social account autoconnect
I got a Django-allauth backed site with legacy local users most of which eventually should be connected to social login upon their next sign-in, whenever that might be. Only supported social provider is Microsoft Graph. All emails from the provider are to be treated as verified, and in case it matches any existing user, these are also treated as the same user without further verification.
Relevant allauth settings as below:
ACCOUNT_LOGIN_METHODS = {"email"}
ACCOUNT_USER_MODEL_USERNAME_FIELD = None
SOCIALACCOUNT_PROVIDERS = {
"microsoft": {
"EMAIL_AUTHENTICATION_AUTO_CONNECT": True,
"EMAIL_AUTHENTICATION": True,
"EMAIL_VERIFICATION": False,
"VERIFIED_EMAIL": True,
"APPS": [
#client id, secret masked
]
}
}
Signing in with a social account that has its e-mail registered (and which should be connected upon login) works, but no connected social account is created.
Signing in with a social account without an existing user creates a new user with the respective social account as expected and desired.
If I write my own hooks to customized SocialAccountAdapter (or add receivers to allauth's signals), I can achieve my target, but at least according to my interpretation of the allauth documentation, this seems a bit hacky and does not seem like the intended way in the current version.
Allauth version is 65.7.0