-
Couldn't load subscription status.
- Fork 38.8k
Description
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:
- Create HttpHeaders.setBearerAuth(String) [SPR-16997] #21535 Create HttpHeaders.setBearerAuth(String)
- BasicAuthorizationInterceptor should add its header conditionally [SPR-17326] #21860 BasicAuthorizationInterceptor should add its header conditionally