From 147896dd66642abc01863688228bca317bde1b4c Mon Sep 17 00:00:00 2001 From: ThuF Date: Fri, 4 Mar 2022 15:07:49 +0200 Subject: [PATCH] Fixes #1642 [Core] Bearer authorization header is not recognized --- .../main/java/org/eclipse/dirigible/oauth/utils/JwtUtils.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/security/security-oauth/src/main/java/org/eclipse/dirigible/oauth/utils/JwtUtils.java b/modules/security/security-oauth/src/main/java/org/eclipse/dirigible/oauth/utils/JwtUtils.java index aa2c341beb3..980cb622521 100644 --- a/modules/security/security-oauth/src/main/java/org/eclipse/dirigible/oauth/utils/JwtUtils.java +++ b/modules/security/security-oauth/src/main/java/org/eclipse/dirigible/oauth/utils/JwtUtils.java @@ -96,8 +96,8 @@ private static String getJwtFromHeader(HttpServletRequest httpServletRequest) { String authorizationHeader = httpServletRequest.getHeader(AUTHORIZATION_HEADER); if (authorizationHeader != null) { // Expected format Authorization header value: Bearer eyJhbGciOiJS... - if (authorizationHeader.startsWith(AUTHORIZATION_HEADER_VALUE_BEARER)) { - String tokenValue = authorizationHeader.replace(AUTHORIZATION_HEADER_VALUE_BEARER, ""); + if (authorizationHeader.toLowerCase().startsWith(AUTHORIZATION_HEADER_VALUE_BEARER.toLowerCase())) { + String tokenValue = authorizationHeader.substring(AUTHORIZATION_HEADER_VALUE_BEARER.length()); if (isValidJwt(httpServletRequest, tokenValue)) { jwt = tokenValue; }