Skip to content

gplazma: check BEARER TOKEN empty case#7819

Merged
mksahakyan merged 1 commit into11.0from
fix/11.0/BearerTokenEmpty
Jun 25, 2025
Merged

gplazma: check BEARER TOKEN empty case#7819
mksahakyan merged 1 commit into11.0from
fix/11.0/BearerTokenEmpty

Conversation

@mksahakyan
Copy link
Contributor

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/

  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/
@mksahakyan mksahakyan merged commit 1542fcf into 11.0 Jun 25, 2025
3 checks passed
@mksahakyan mksahakyan deleted the fix/11.0/BearerTokenEmpty branch June 25, 2025 15:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant