Take into account that backends **must** be defined in AUTHENTICATION_BACKENDS_
or Django won't pick them when trying to authenticate the user.
+- Define desired backends for your site::
+
+ SOCIAL_AUTH_ENABLED_BACKENDS = ('google', 'google-oauth', 'facebook', ...)
+
+ All backends are enabled by default.
+
- Setup needed OAuth keys (see OAuth_ section for details)::
TWITTER_CONSUMER_KEY = ''
Take into account that backends **must** be defined in AUTHENTICATION_BACKENDS_
or Django won't pick them when trying to authenticate the user.
+- Define desired backends for your site::
+
+ SOCIAL_AUTH_ENABLED_BACKENDS = ('google', 'google-oauth', 'facebook', ...)
+
+ All backends are enabled by default.
+
- Setup needed OAuth keys (see OAuth_ section for details)::
TWITTER_CONSUMER_KEY = ''
'django.contrib.auth.backends.ModelBackend',
)
+#SOCIAL_AUTH_ENABLED_BACKENDS = ('google', 'google-oauth', 'facebook')
+
LOGIN_REDIRECT_URL = '/'
try:
def get_backends():
backends = {}
+ enabled_backends = _setting('SOCIAL_AUTH_ENABLED_BACKENDS')
for mod_name in SOCIAL_AUTH_IMPORT_SOURCES:
try:
# register only enabled backends
backends.update(((key, val)
for key, val in sub.BACKENDS.items()
- if val.enabled()))
+ if val.enabled() and
+ (not enabled_backends or
+ key in enabled_backends)))
except (ImportError, AttributeError):
pass
return backends