more work on social login
This commit is contained in:
@@ -57,7 +57,9 @@ INSTALLED_APPS = [
|
||||
'storages',
|
||||
'mapwidgets',
|
||||
'django_admin_listfilter_dropdown',
|
||||
'oauth2_provider',
|
||||
'social_django',
|
||||
'rest_framework_social_oauth2',
|
||||
|
||||
# local apps
|
||||
'core',
|
||||
@@ -130,13 +132,14 @@ AUTH_PASSWORD_VALIDATORS = [
|
||||
AUTH_USER_MODEL = 'core.CustomUser'
|
||||
|
||||
AUTHENTICATION_BACKENDS = (
|
||||
'social_core.backends.github.GithubOAuth2',
|
||||
'social_core.backends.twitter.TwitterOAuth',
|
||||
'social_core.backends.facebook.FacebookOAuth2',
|
||||
|
||||
'rest_framework_social_oauth2.backends.DjangoOAuth2',
|
||||
'django.contrib.auth.backends.ModelBackend',
|
||||
)
|
||||
|
||||
DRFSO2_PROPRIETARY_BACKEND_NAME = os.getenv('DRFSO2_PROPRIETARY_BACKEND_NAME') # E.g. Facebook
|
||||
DRFSO2_URL_NAMESPACE = os.getenv('DRFSO2_URL_NAMESPACE') # namespace for reversing URLs
|
||||
|
||||
|
||||
# DRF Options
|
||||
REST_FRAMEWORK = {
|
||||
'DEFAULT_PERMISSION_CLASSES': [
|
||||
@@ -144,6 +147,9 @@ REST_FRAMEWORK = {
|
||||
],
|
||||
'DEFAULT_AUTHENTICATION_CLASSES': [
|
||||
'rest_framework_simplejwt.authentication.JWTAuthentication',
|
||||
|
||||
'oauth2_provider.contrib.rest_framework.OAuth2Authentication',
|
||||
'rest_framework_social_oauth2.authentication.SocialAuthentication',
|
||||
],
|
||||
'DEFAULT_FILTER_BACKENDS': ['django_filters.rest_framework.DjangoFilterBackend'],
|
||||
'DEFAULT_PAGINATION_CLASS': 'rest_framework.pagination.LimitOffsetPagination',
|
||||
|
||||
Reference in New Issue
Block a user