Python django allauth不保存google额外数据
下面是我的Python django allauth不保存google额外数据,python,django,google-oauth,django-allauth,Python,Django,Google Oauth,Django Allauth,下面是我的settings.py的用法 # other settings SOCIALACCOUNT_PROVIDERS = { 'facebook': { 'SCOPE': [ 'email', 'public_profile', 'user_friends', 'user_gender', 'user_birthday',
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配合得很好,我在那里得到了我想要的东西,但与谷歌配合,签名时一切都会工作(请求权限..一切都会进行),它会对用户进行身份验证,并将其保存在数据库中,但在我刚刚得到的额外数据字段中
{
"id": "...",
"email": "...",
"verified_email": true,
"name": "..",
"given_name": "..",
"picture": "..",
"locale": "en"
}
那么生日、性别、地址、年龄范围和其他字段会发生什么情况。受数据保护的字段,如生日、性别、地址、年龄范围,默认情况下通常设置为私有。因此,外部API访问仅限于该给定用户的公共字段 例如,生日: 如果您访问自己的帐户。您会注意到,它可能被设置为“仅限我”,表示它被设置为“专用” 为了访问您被限制访问的所有字段,您必须更改所有组件的配置文件配置,使其成为公共的