From 51a480569a4e85ad346ad7ef882c49f966b9729e Mon Sep 17 00:00:00 2001 From: Kumi Date: Tue, 2 Aug 2022 11:49:45 +0200 Subject: [PATCH] Populate standard claims --- core/oidc/__init__.py | 1 + core/oidc/userinfo.py | 4 ++++ doc/uwsgi.ini | 10 ++++++++++ kumidc/settings.py | 4 ++++ 4 files changed, 19 insertions(+) create mode 100644 core/oidc/__init__.py create mode 100644 core/oidc/userinfo.py create mode 100644 doc/uwsgi.ini diff --git a/core/oidc/__init__.py b/core/oidc/__init__.py new file mode 100644 index 0000000..c59e4e1 --- /dev/null +++ b/core/oidc/__init__.py @@ -0,0 +1 @@ +from .userinfo import userinfo \ No newline at end of file diff --git a/core/oidc/userinfo.py b/core/oidc/userinfo.py new file mode 100644 index 0000000..d945a46 --- /dev/null +++ b/core/oidc/userinfo.py @@ -0,0 +1,4 @@ +def userinfo(claims, user): + claims['email'] = user.email + + return claims \ No newline at end of file diff --git a/doc/uwsgi.ini b/doc/uwsgi.ini new file mode 100644 index 0000000..be2e412 --- /dev/null +++ b/doc/uwsgi.ini @@ -0,0 +1,10 @@ +[uwsgi] +uid = kumidc +gid = kumidc +chdir = /opt/kumidc +threads = 20 +chmod-socket = 666 +socket = /var/sockets/kumidc.sock +virtualenv = /opt/kumidc/venv/ +module = kumidc.wsgi:application +plugins = python \ No newline at end of file diff --git a/kumidc/settings.py b/kumidc/settings.py index 7120a30..bba5f64 100644 --- a/kumidc/settings.py +++ b/kumidc/settings.py @@ -126,3 +126,7 @@ STATIC_ROOT = CONFIG_FILE.config.get("App", "StaticDir", fallback=BASE_DIR / "st # https://docs.djangoproject.com/en/4.0/ref/settings/#default-auto-field DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField' + +# OIDC Configuration + +OIDC_USERINFO = 'core.oidc.userinfo' \ No newline at end of file