Commit 8504dea
committed
gplazma: check BEARER TOKEN empty case
Motivation
As reported by KIT, a LoginNamePrincipal has started to appear in their logs ( (ticket #10723)). This was due the Bearer (with an empty token).
In this case, getHeader("Authorization") returns a trimmed string, so the authorizationScheme ends up being set to HttpServletRequest.BASIC_AUTH.
Indecipherable login credential for CMS at GridKa)
Modification
It should be checked not only whether the Authorization header is non-null, but also whether it is empty (i.e., an empty BEARER_TOKEN is being used).
And the empty token should be rejected
Acked-by: Tigran Mkrtchyan
Target: master, 11.0, 10.2, 10.1, 10.0, 9.2
Require-book: no
Require-notes: yes
Patch: https://rb.dcache.org/r/14462/1 parent 96de401 commit 8504dea
File tree
2 files changed
+11
-4
lines changed- modules
- common/src/main/java/org/dcache/auth
- dcache/src/main/java/org/dcache/http
2 files changed
+11
-4
lines changedLines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| 26 | + | |
26 | 27 | | |
27 | 28 | | |
28 | 29 | | |
| |||
Lines changed: 10 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
439 | 439 | | |
440 | 440 | | |
441 | 441 | | |
| 442 | + | |
| 443 | + | |
442 | 444 | | |
443 | 445 | | |
444 | 446 | | |
445 | 447 | | |
446 | 448 | | |
447 | | - | |
448 | 449 | | |
449 | | - | |
450 | | - | |
451 | | - | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
452 | 458 | | |
453 | 459 | | |
454 | 460 | | |
| |||
0 commit comments