diff --git a/adapters/oidc/adapter-core/src/main/java/org/keycloak/adapters/BearerTokenRequestAuthenticator.java b/adapters/oidc/adapter-core/src/main/java/org/keycloak/adapters/BearerTokenRequestAuthenticator.java index eeda3e3429..8e472ae080 100755 --- a/adapters/oidc/adapter-core/src/main/java/org/keycloak/adapters/BearerTokenRequestAuthenticator.java +++ b/adapters/oidc/adapter-core/src/main/java/org/keycloak/adapters/BearerTokenRequestAuthenticator.java @@ -72,8 +72,13 @@ public class BearerTokenRequestAuthenticator { for (String authHeader : authHeaders) { String[] split = authHeader.trim().split("\\s+"); if (split == null || split.length != 2) continue; - if (!split[0].equalsIgnoreCase("Bearer")) continue; - tokenString = split[1]; + if (split[0].equalsIgnoreCase("Bearer")) { + tokenString = split[1]; + if (log.isDebugEnabled()) { + log.debugf("Found [%s] values in authorization header, selecting the first value for Bearer.", authHeaders.size()); + } + break; + }; } if (tokenString == null) {