[KEYCLOAK-6928] - Selecting first bearer if multiple values exists in authorization header
This commit is contained in:
parent
efe6a38648
commit
2da758ac86
1 changed files with 7 additions and 2 deletions
|
@ -72,8 +72,13 @@ public class BearerTokenRequestAuthenticator {
|
||||||
for (String authHeader : authHeaders) {
|
for (String authHeader : authHeaders) {
|
||||||
String[] split = authHeader.trim().split("\\s+");
|
String[] split = authHeader.trim().split("\\s+");
|
||||||
if (split == null || split.length != 2) continue;
|
if (split == null || split.length != 2) continue;
|
||||||
if (!split[0].equalsIgnoreCase("Bearer")) continue;
|
if (split[0].equalsIgnoreCase("Bearer")) {
|
||||||
tokenString = split[1];
|
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) {
|
if (tokenString == null) {
|
||||||
|
|
Loading…
Reference in a new issue