core: fix PropertyMapping context not being available in request context
Signed-off-by: Jens Langhammer <jens@goauthentik.io>
This commit is contained in:
parent
4a8c0f7f80
commit
d535a82372
|
@ -44,6 +44,7 @@ class PropertyMappingEvaluator(BaseEvaluator):
|
||||||
if request:
|
if request:
|
||||||
req.http_request = request
|
req.http_request = request
|
||||||
self._context["request"] = req
|
self._context["request"] = req
|
||||||
|
req.context.update(**kwargs)
|
||||||
self._context.update(**kwargs)
|
self._context.update(**kwargs)
|
||||||
self.dry_run = dry_run
|
self.dry_run = dry_run
|
||||||
|
|
||||||
|
|
|
@ -14,8 +14,11 @@ entries:
|
||||||
expression: |
|
expression: |
|
||||||
# This mapping is used by the authentik proxy. It passes extra user attributes,
|
# This mapping is used by the authentik proxy. It passes extra user attributes,
|
||||||
# which are used for example for the HTTP-Basic Authentication mapping.
|
# which are used for example for the HTTP-Basic Authentication mapping.
|
||||||
|
session_id = None
|
||||||
|
if "token" in request.context:
|
||||||
|
session_id = request.context.get("token").session_id
|
||||||
return {
|
return {
|
||||||
"sid": token.session_id,
|
"sid": session_id,
|
||||||
"ak_proxy": {
|
"ak_proxy": {
|
||||||
"user_attributes": request.user.group_attributes(request),
|
"user_attributes": request.user.group_attributes(request),
|
||||||
"is_superuser": request.user.is_superuser,
|
"is_superuser": request.user.is_superuser,
|
||||||
|
|
Reference in a new issue