Skip to content

Create HttpHeaders.setBasicAuth(String username, String password) [SPR-16913] #21452

@spring-projects-issues

Description

@spring-projects-issues

Rob Winch opened SPR-16913 and commented

A disadvantage of the current WebClient HTTP Basic support is that you must have an ExchangeFilterFunction registered to process the client attribute. Since the support for HTTP Basic was added for WebClient the API has been modified the addition of RequestHeadersSpec.headers(Consumer<HttpHeaders>) has been added which would work very well for HTTP Basic support without the need for an ExchangeFilterFunction.

We should create a static method Consumer<HttpHeaders> httpBasic(String username, String password) that adds HTTP Basic authentication to the headers. This approach does not require an ExchangeFilterFunction to be registered for the header to be added to the request.

 


Issue Links:

Referenced from: commits e485abb, a663454, 6bcf6ff

Metadata

Metadata

Assignees

Labels

in: webIssues in web modules (web, webmvc, webflux, websocket)type: enhancementA general enhancement

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions