[KEYCLOAK-6928] - Selecting first bearer if multiple values exists in authorization header

This commit is contained in:
Pedro Igor 2018-09-28 12:44:13 -03:00
parent efe6a38648
commit 2da758ac86

View file

@ -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;
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) {