server/src/metaeducation/settings/__init__.py
changeset 6 39cecdd5260e
parent 1 5f50937893ac
child 9 fdbc47f06361
--- a/server/src/metaeducation/settings/__init__.py	Mon Feb 29 12:22:07 2016 +0100
+++ b/server/src/metaeducation/settings/__init__.py	Mon Feb 29 12:23:37 2016 +0100
@@ -46,6 +46,14 @@
     'allauth.account.auth_backends.AuthenticationBackend',
 )
 
+REST_FRAMEWORK = {
+    'DEFAULT_AUTHENTICATION_CLASSES': (
+        'metaeducation.auth.MtdcOAuth2ClientCredentialsAuthentication',
+        'rest_framework.authentication.BasicAuthentication',
+        'rest_framework.authentication.SessionAuthentication',
+    )
+}
+
 MIDDLEWARE_CLASSES = (
     'django.contrib.sessions.middleware.SessionMiddleware',
     'django.middleware.common.CommonMiddleware',
@@ -86,6 +94,8 @@
 
 USE_TZ = True
 
+SESSION_ENGINE = 'django.contrib.sessions.backends.signed_cookies'
+
 # Static files (CSS, JavaScript, Images)
 # https://docs.djangoproject.com/en/1.8/howto/static-files/
 STATIC_URL = '/static/'
@@ -109,6 +119,7 @@
 
 #ACCOUNT_AUTHENTICATION_METHOD = "username"
 #ACCOUNT_ADAPTER = "allauth.account.adapter.DefaultAccountAdapter"
+SOCIALACCOUNT_ADAPTER = "metaeducation.mtdc_oauth_provider.views.MtdcOAuth2Adapter"
 SOCIALACCOUNT_PROVIDERS = {
     'mtdc': {
         'SCOPE': ['basic']