Skip to content

Commit

Permalink
fix: oidc debug extra usage
Browse files Browse the repository at this point in the history
KK-1168
  • Loading branch information
nikomakela committed Aug 28, 2024
1 parent defcc22 commit f1265a1
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions kukkuu/oidc.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,9 @@ def _validate_symmetrically_signed_jwt(self, jwt: JWT):
The `helusers` always uses a issuer specific `OIDCConfig` that fetches the
keys from a server (from a path "/.well-known/openid-configuration").
"""
logger.debug("Validating a symmetrically signed test JWT", extra=jwt)
logger.debug(
"Validating a symmetrically signed test JWT", extra={"jwt_str": str(jwt)}
)
try:
jwt.validate_issuer()
except ValidationError as e:
Expand Down Expand Up @@ -118,9 +120,15 @@ def authenticate_test_user(self, jwt: JWT):
"""
logger.info("Authenticating with a test JWT!")
self._validate_symmetrically_signed_jwt(jwt)
logger.debug("The symmetrically signed JWT was valid.", extra=jwt)
logger.debug(
"The symmetrically signed JWT was valid.", extra={"jwt_str": str(jwt)}
)
user = get_or_create_user(jwt.claims, oidc=True)
logger.debug("The user %s returned from get_or_create_user", user, extra=user)
logger.debug(
"The user %s returned from get_or_create_user",
user,
extra={"user_dict": user.__dict__ if user else None},
)
return UserAuthorization(user, jwt.claims)

def authenticate(self, request):
Expand Down

0 comments on commit f1265a1

Please sign in to comment.