From b0d2ed48b04a2ea3cd53b9e7b685848d5f30207c Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 17 Apr 2024 08:30:35 +0000 Subject: [PATCH 1/4] Create PR for #259 From dc607e31126937ec143738c3947aa679653926fc Mon Sep 17 00:00:00 2001 From: Volker Hartmann Date: Wed, 17 Apr 2024 11:38:58 +0200 Subject: [PATCH 2/4] Catch additional exception while validating local token. --- .../kit/datamanager/security/filter/KeycloakTokenFilter.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/main/java/edu/kit/datamanager/security/filter/KeycloakTokenFilter.java b/src/main/java/edu/kit/datamanager/security/filter/KeycloakTokenFilter.java index 7a0cb43c..c8bacbf9 100644 --- a/src/main/java/edu/kit/datamanager/security/filter/KeycloakTokenFilter.java +++ b/src/main/java/edu/kit/datamanager/security/filter/KeycloakTokenFilter.java @@ -29,6 +29,7 @@ import io.jsonwebtoken.ExpiredJwtException; import io.jsonwebtoken.Jws; import io.jsonwebtoken.MalformedJwtException; +import io.jsonwebtoken.UnsupportedJwtException; import org.springframework.security.core.context.SecurityContextHolder; import org.springframework.security.web.authentication.WebAuthenticationDetailsSource; import org.springframework.web.filter.OncePerRequestFilter; @@ -181,6 +182,8 @@ private boolean attemptLocalAuthentication(HttpServletRequest request, HttpServl throw new MalformedJwtException("Your token is malformed."); } catch (IllegalArgumentException ex) { LOG.debug("Illegal argument exception while local authentication attempt.", ex); + } catch (UnsupportedJwtException ex) { + LOG.debug("Unsupported JwtException while local authentication attempt.", e); } return authenticated; } From 972488898acd4e2c7238e3fe2397bfa32e34d66b Mon Sep 17 00:00:00 2001 From: Volker Hartmann Date: Wed, 17 Apr 2024 11:47:16 +0200 Subject: [PATCH 3/4] Fix typo. --- .../kit/datamanager/security/filter/KeycloakTokenFilter.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/edu/kit/datamanager/security/filter/KeycloakTokenFilter.java b/src/main/java/edu/kit/datamanager/security/filter/KeycloakTokenFilter.java index c8bacbf9..5fa1e6b5 100644 --- a/src/main/java/edu/kit/datamanager/security/filter/KeycloakTokenFilter.java +++ b/src/main/java/edu/kit/datamanager/security/filter/KeycloakTokenFilter.java @@ -183,7 +183,7 @@ private boolean attemptLocalAuthentication(HttpServletRequest request, HttpServl } catch (IllegalArgumentException ex) { LOG.debug("Illegal argument exception while local authentication attempt.", ex); } catch (UnsupportedJwtException ex) { - LOG.debug("Unsupported JwtException while local authentication attempt.", e); + LOG.debug("Unsupported JwtException while local authentication attempt.", ex); } return authenticated; } From 8afa923535122891a8bc85c8cfd65be8c594c903 Mon Sep 17 00:00:00 2001 From: Volker Hartmann Date: Wed, 17 Apr 2024 11:56:47 +0200 Subject: [PATCH 4/4] Update CHANGELOG.md --- CHANGELOG.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9b4be3f8..a619a710 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed +## [1.3.1] - 2024-04-17 + +### Fixed +* Problem while validating keycloak tokens. + ## [1.3.0] - 2024-04-12 ### Added @@ -284,7 +289,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Security - none -[Unreleased]: https://github.com/kit-data-manager/service-base/compare/v1.3.0...HEAD +[Unreleased]: https://github.com/kit-data-manager/service-base/compare/v1.3.1...HEAD +[1.3.1]: https://github.com/kit-data-manager/service-base/compare/v1.3.0...v1.3.1 [1.3.0]: https://github.com/kit-data-manager/service-base/compare/v1.2.1...v1.3.0 [1.2.1]: https://github.com/kit-data-manager/service-base/compare/v1.2.0...v1.2.1 [1.2.0]: https://github.com/kit-data-manager/service-base/compare/v1.1.1...v1.2.0