Enable SCIM

This commit is contained in:
Xeryus Stokkel 2022-01-13 11:48:29 +01:00
parent dbed3bd2f7
commit 069a61e4d7
Signed by: Xeryus Stokkel
GPG Key ID: 7023C2C891DDE681
2 changed files with 21 additions and 3 deletions

View File

@ -37,6 +37,8 @@ INSTALLED_APPS = [
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'django_scim',
]
MIDDLEWARE = [
@ -45,6 +47,7 @@ MIDDLEWARE = [
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django_scim.middleware.SCIMAuthCheckMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
]
@ -75,8 +78,11 @@ WSGI_APPLICATION = 'scim_app.wsgi.application'
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': BASE_DIR / 'db.sqlite3',
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'NAME': 'scim',
'USER': 'scim',
'PASSWORD': 'development',
'HOST': 'localhost',
}
}
@ -121,3 +127,14 @@ STATIC_URL = 'static/'
# https://docs.djangoproject.com/en/4.0/ref/settings/#default-auto-field
DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'
SCIM_SERVICE_PROVIDER = {
'NETLOC': 'localhost',
'AUTHENTICATION_SCHEMES': [
{
'type': 'oauth2',
'name': 'OAuth 2',
'description': 'OAuth 2 implemented with bearer token',
},
],
}

View File

@ -14,8 +14,9 @@ Including another URLconf
2. Add a URL to urlpatterns: path('blog/', include('blog.urls'))
"""
from django.contrib import admin
from django.urls import path
from django.urls import include, path
urlpatterns = [
path('admin/', admin.site.urls),
path('scim/v2/', include('django_scim.urls')),
]