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; }