| 1 |
Configuration |
| 2 |
============= |
| 3 |
|
| 4 |
Available settings: |
| 5 |
|
| 6 |
``SOCIALACCOUNT_ADAPTER`` (default: ``"allauth.socialaccount.adapter.DefaultSocialAccountAdapter"``) |
| 7 |
Specifies the adapter class to use, allowing you to alter certain |
| 8 |
default behaviour. |
| 9 |
|
| 10 |
``SOCIALACCOUNT_AUTO_SIGNUP`` (default: ``True``) |
| 11 |
Attempt to bypass the signup form by using fields (e.g. username, |
| 12 |
email) retrieved from the social account provider. If a conflict |
| 13 |
arises due to a duplicate email address the signup form will still |
| 14 |
kick in. |
| 15 |
|
| 16 |
``SOCIALACCOUNT_EMAIL_AUTHENTICATION`` (default: ``False``) |
| 17 |
Consider a scenario where a social login occurs, and the social account comes |
| 18 |
with a verified email address (verified by the account provider), but that |
| 19 |
email address is already taken by a local user account. Additionally, assume |
| 20 |
that the local user account does not have any social account connected. Now, |
| 21 |
if the provider can be fully trusted, you can argue that we should treat this |
| 22 |
scenario as a login to the existing local user account even if the local |
| 23 |
account does not already have the social account connected, because -- |
| 24 |
according to the provider -- the user logging in has ownership of the email |
| 25 |
address. This is how this scenario is handled when |
| 26 |
``SOCIALACCOUNT_EMAIL_AUTHENTICATION`` is set to ``True``. As this implies |
| 27 |
that an untrustworthy provider can login to any local account by fabricating |
| 28 |
social account data, this setting defaults to ``False``. Only set it to |
| 29 |
``True`` if you are using providers that can be fully trusted. Instead of |
| 30 |
turning this on globally, you can also turn it on selectively per provider, |
| 31 |
for example:: |
| 32 |
|
| 33 |
SOCIALACCOUNT_PROVIDERS = { |
| 34 |
'google': { |
| 35 |
'EMAIL_AUTHENTICATION': True |
| 36 |
} |
| 37 |
} |
| 38 |
|
| 39 |
``SOCIALACCOUNT_EMAIL_AUTHENTICATION_AUTO_CONNECT`` (default: ``False``) |
| 40 |
In case email authentication is applied, this setting controls whether or not |
| 41 |
the social account is automatically connected to the local account. In case of |
| 42 |
``False`` the local account remains unchanged during the login. In case of |
| 43 |
``True``, the social account for which the email matched, is automatically |
| 44 |
added to the list of social accounts connected to the local account. As a |
| 45 |
result, even if the user were to change the email address afterwards, social |
| 46 |
login would still be possible when using ``True``, but not in case of |
| 47 |
``False``. |
| 48 |
|
| 49 |
``SOCIALACCOUNT_EMAIL_VERIFICATION`` (default: ``ACCOUNT_EMAIL_VERIFICATION``) |
| 50 |
As ``ACCOUNT_EMAIL_VERIFICATION``, but for social accounts. |
| 51 |
|
| 52 |
``SOCIALACCOUNT_EMAIL_REQUIRED`` (default: ``"email*" in ACCOUNT_SIGNUP_FIELDS``) |
| 53 |
The user is required to hand over an email address when signing up |
| 54 |
using a social account. |
| 55 |
|
| 56 |
``SOCIALACCOUNT_FORMS`` |
| 57 |
Used to override forms. Defaults to:: |
| 58 |
|
| 59 |
SOCIALACCOUNT_FORMS = { |
| 60 |
'disconnect': 'allauth.socialaccount.forms.DisconnectForm', |
| 61 |
'signup': 'allauth.socialaccount.forms.SignupForm', |
| 62 |
} |
| 63 |
|
| 64 |
``SOCIALACCOUNT_LOGIN_ON_GET`` (default: ``False``) |
| 65 |
Controls whether or not the endpoints for initiating a social login (for |
| 66 |
example, "/accounts/google/login/") require a POST request to initiate the |
| 67 |
handshake. For security considerations, it is strongly recommended to |
| 68 |
require POST requests. |
| 69 |
|
| 70 |
``SOCIALACCOUNT_PROVIDERS`` (default: ``{}``) |
| 71 |
Dictionary containing `provider specific settings <provider_configuration.html>`__. |
| 72 |
|
| 73 |
``SOCIALACCOUNT_REQUESTS_TIMEOUT`` (default: ``5``) |
| 74 |
The timeout applied when performing upstream requests. |
| 75 |
|
| 76 |
``SOCIALACCOUNT_QUERY_EMAIL`` (default: ``"email*" in ACCOUNT_SIGNUP_FIELDS``) |
| 77 |
Request email address from 3rd party account provider? E.g. using |
| 78 |
OpenID AX, or the Facebook "email" permission. |
| 79 |
|
| 80 |
``SOCIALACCOUNT_SOCIALACCOUNT_STR`` (default: ``str`` of user object) |
| 81 |
Used to override the str value for the SocialAccount model. |
| 82 |
|
| 83 |
Must be a function accepting a single parameter for the socialaccount object. |
| 84 |
|
| 85 |
``SOCIALACCOUNT_STORE_TOKENS`` (default: ``False``) |
| 86 |
Indicates whether or not the access tokens are stored in the database. Note that |
| 87 |
tokens can only be stored if the related social account is stored as well, which |
| 88 |
is not the case when you are using ``SOCIALACCOUNT_EMAIL_AUTHENTICATION`` without |
| 89 |
``SOCIALACCOUNT_EMAIL_AUTHENTICATION_AUTO_CONNECT``. |
| 90 |
|
| 91 |
``SOCIALACCOUNT_ONLY`` (default: ``False``) |
| 92 |
When enabled (``True``), all functionality with regard to local accounts is |
| 93 |
disabled, and users will only be able to authenticate using third-party |
| 94 |
providers. |
| 95 |
|
| 96 |
``SOCIALACCOUNT_OPENID_CONNECT_URL_PREFIX`` (default: ``"oidc"``) |
| 97 |
The URL path prefix that is used for all OpenID Connect providers. By default, |
| 98 |
it is set to ``"oidc"``, meaning, an OpenID Connect provider with provider ID |
| 99 |
``foo`` uses ``/accounts/oidc/foo/login/`` as its login URL. |