From 08f0aca894c147c11fceeabe1cb9f7c2010a7010 Mon Sep 17 00:00:00 2001 From: "Langhammer, Jens" Date: Mon, 11 Nov 2019 13:19:54 +0100 Subject: [PATCH] provider/oidc(minor): include claims in id_token --- passbook/providers/oidc/settings.py | 1 + passbook/root/settings.py | 74 ++++++++++++++--------------- 2 files changed, 38 insertions(+), 37 deletions(-) diff --git a/passbook/providers/oidc/settings.py b/passbook/providers/oidc/settings.py index 6e27f4457..2a20f3baa 100644 --- a/passbook/providers/oidc/settings.py +++ b/passbook/providers/oidc/settings.py @@ -5,3 +5,4 @@ INSTALLED_APPS = [ ] OIDC_AFTER_USERLOGIN_HOOK = "passbook.providers.oidc.lib.check_permissions" +OIDC_IDTOKEN_INCLUDE_CLAIMS = True diff --git a/passbook/root/settings.py b/passbook/root/settings.py index 6ffc07135..25b302dcc 100644 --- a/passbook/root/settings.py +++ b/passbook/root/settings.py @@ -302,46 +302,46 @@ LOG_PRE_CHAIN = [ structlog.processors.TimeStamper(), ] -with CONFIG.cd('log'): - LOGGING_HANDLER_MAP = { - 'passbook': 'DEBUG', - 'django': 'WARNING', - 'celery': 'WARNING', - 'grpc': 'DEBUG', - 'oauthlib': 'DEBUG', - 'oauth2_provider': 'DEBUG', - } - LOGGING = { - 'version': 1, - 'disable_existing_loggers': False, - 'formatters': { - "plain": { - "()": structlog.stdlib.ProcessorFormatter, - "processor": structlog.processors.JSONRenderer(sort_keys=True), - "foreign_pre_chain": LOG_PRE_CHAIN, - }, - "colored": { - "()": structlog.stdlib.ProcessorFormatter, - "processor": structlog.dev.ConsoleRenderer(colors=DEBUG), - "foreign_pre_chain": LOG_PRE_CHAIN, - }, +LOGGING = { + 'version': 1, + 'disable_existing_loggers': False, + 'formatters': { + "plain": { + "()": structlog.stdlib.ProcessorFormatter, + "processor": structlog.processors.JSONRenderer(sort_keys=True), + "foreign_pre_chain": LOG_PRE_CHAIN, }, - 'handlers': { - 'console': { - 'level': DEBUG, - 'class': 'logging.StreamHandler', - 'formatter': "colored" if DEBUG else "plain", - }, + "colored": { + "()": structlog.stdlib.ProcessorFormatter, + "processor": structlog.dev.ConsoleRenderer(colors=DEBUG), + "foreign_pre_chain": LOG_PRE_CHAIN, }, - 'loggers': { - } + }, + 'handlers': { + 'console': { + 'level': DEBUG, + 'class': 'logging.StreamHandler', + 'formatter': "colored" if DEBUG else "plain", + }, + }, + 'loggers': { + } +} +_LOGGING_HANDLER_MAP = { + 'passbook': 'DEBUG', + 'django': 'WARNING', + 'celery': 'WARNING', + 'grpc': 'DEBUG', + 'oauthlib': 'DEBUG', + 'oauth2_provider': 'DEBUG', + 'oidc_provider': 'DEBUG', +} +for handler_name, level in _LOGGING_HANDLER_MAP.items(): + LOGGING['loggers'][handler_name] = { + 'handlers': ['console'], + 'level': level, + 'propagate': True, } - for handler_name, level in LOGGING_HANDLER_MAP.items(): - LOGGING['loggers'][handler_name] = { - 'handlers': ['console'], - 'level': level, - 'propagate': True, - } TEST = False TEST_RUNNER = 'xmlrunner.extra.djangotestrunner.XMLTestRunner'