django-allauth
django-allauth copied to clipboard
Pattern for requesting and persisting phone number(s) via OAuth providers?
I've spent a bit of time looking through documentation, issues, and source code but haven't found clear patterns for:
- Requesting phone numbers to be included in user data obtained from OAuth provider(s);
- persisting the phone number(s) (could be more than one I assume) in our DB.
Am I missing something or is this just something that everyone has to/does figure out on demand?
It will depend on the provider and the configuration of the provider within django-allauth, for example Facebook has a FIELDS setting within facebooks SOCIALACCOUNT_PROVIDERS configuration.
From there you can use an custom SocialAccountAdapter to override save_user which has a sociallogin parameter. The extra data sent by the provider should be located in sociallogin.account.extra_data