Skip to content

BasicAuthenticator checks only the first WWW-Authenticate header #5883

Open
@ychernysh

Description

@ychernysh

BasicAuthenticator from jersey-client library currently only checks the first value of WWW-Authentication header:

final String authenticate = response.getHeaders().getFirst(HttpHeaders.WWW_AUTHENTICATE);

Which means that if a server returned multiple WWW-Authenticate headers (say, for Basic & Bearer authentication methods), and Basic IS in that list, but IS NOT the first value, which might be the case, then BasicAuthenticator will fail to do its job.
This ticket is to make BasicAuthenticator honor the case above by checking all of the WWW-Authenticate values (to pick the one that starts with Basic).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions