django-allauth 不保存谷歌额外数据

问题描述

我的settings.py怎么样了

# other settings

SOCIALACCOUNT_PROVIDERS = {
    'facebook': {
        'ScopE': [
            'email','public_profile','user_friends','user_gender','user_birthday','user_location','user_link','user_age_range',],'FIELDS': [
            'id','first_name','last_name','middle_name','name','short_name','name_format','gender','birthday','age_range','friends','location','picture','link','EXCHANGE_TOKEN': True,'VERIFIED_EMAIL': False,'VERSION': 'v7.0',},'google': {
        'ScopE': [
            'https://www.googleapis.com/auth/userinfo.profile','https://www.googleapis.com/auth/userinfo.email','https://www.googleapis.com/auth/user.emails.read','https://www.googleapis.com/auth/user.phonenumbers.read','https://www.googleapis.com/auth/user.birthday.read','https://www.googleapis.com/auth/profile.agerange.read','https://www.googleapis.com/auth/user.addresses.read','AUTH_ParaMS': {
            'access_type': 'online',}
    }
}

它在 facebook 上运行良好,我在那里得到了我想要的东西,但是在 google 下,一切都会在签名时正常工作(请求权限......一切都会)它会进行身份验证用户并将其保存在 db 上,但在 额外数据 字段上我只是得到

{
  "id": "...","email": "...","verified_email": true,"name": "..","given_name": "..","picture": "..","locale": "en"
}

那么生日性别地址年龄范围和其他字段会发生什么变化。

解决方法

数据保护字段,例如生日、性别、地址、年龄范围,通常默认设置为私人。因此,外部 API 访问仅限于该给定用户的公共字段。

例如,生日:

如果您访问自己帐户的 birthday。您会注意到它可能被设置为 'Only Me',表示它被设置为私有。

为了访问您被限制访问的所有字段,您必须为所有组件更改此配置文件配置,使它们公开