Private
Public Access
1
0

Oauth2 provider and initial api

This commit is contained in:
Sander Roosendaal
2016-11-20 14:46:46 +01:00
parent 60edc3f3c2
commit d57ecb495b
6 changed files with 89 additions and 4611 deletions

View File

@@ -49,8 +49,7 @@ INSTALLED_APPS = [
'django_mailbox',
'rest_framework',
'rest_framework_swagger',
'provider',
# 'provider.oauth2',
'oauth2_provider',
]
MIDDLEWARE_CLASSES = [
@@ -61,6 +60,7 @@ MIDDLEWARE_CLASSES = [
'django.middleware.common.CommonMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
'oauth2_provider.middleware.OAuth2TokenMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
'debug_toolbar.middleware.DebugToolbarMiddleware',
@@ -240,11 +240,12 @@ REST_FRAMEWORK = {
# Use Django's standard `django.contrib.auth` permissions,
# or allow read-only access for unauthenticated users.
'DEFAULT_PERMISSION_CLASSES': [
'rest_framework.permissions.DjangoModelPermissionsOrAnonReadOnly'
'rest_framework.permissions.IsAuthenticated'
],
'DEFAULT_AUTHENTICATION_CLASSES': (
'rest_framework.authentication.BasicAuthentication',
'rest_framework.authentication.SessionAuthentication',
# 'rest_framework.authentication.OAuth2Authentication',
'oauth2_provider.ext.rest_framework.OAuth2Authentication',
),
'PAGE_SIZE': 20,
}