Private
Public Access
1
0

Oauth2 checks

This commit is contained in:
Sander Roosendaal
2016-11-24 13:40:29 +01:00
parent b8643ca897
commit 44b2145f2f
2 changed files with 20 additions and 1 deletions

View File

@@ -50,13 +50,21 @@ INSTALLED_APPS = [
'rest_framework',
'rest_framework_swagger',
'oauth2_provider',
'corsheaders',
]
AUTHENTICATION_BACKENDS = (
'oauth2_provider.backends.OAuth2Backend',
# Uncomment following if you want to access the admin
'django.contrib.auth.backends.ModelBackend',
)
MIDDLEWARE_CLASSES = [
'django.middleware.csrf.CsrfViewMiddleware',
'django.middleware.security.SecurityMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.locale.LocaleMiddleware',
'corsheaders.middleware.CorsMiddleware',
'django.middleware.common.CommonMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
@@ -90,6 +98,8 @@ TEMPLATES = [
]
#CORS_ORIGIN_ALLOW_ALL = True
WSGI_APPLICATION = 'rowsandall_app.wsgi.application'
@@ -234,6 +244,14 @@ EMAIL_USE_TLS = True
FORECAST_IO_KEY = "bc8196fbd89f11375c7dfc8aa6323c72"
GMAPIKEY = "AIzaSyAgu1w9QSthaGPMLp8y9JedPoMc9sfEgJ8"
# OAUTH2
OAUTH2_PROVIDER = {
# this is the list of available scopes
'SCOPES': {'read': 'Read scope', 'write': 'Write scope', 'groups': 'Access to your groups'}
}
# REST Framework
REST_FRAMEWORK = {