Skip to content

Simplify security usage in standalone webclient #1733

Open
@tomas-langer

Description

Currently when we want to invoke a secure request, we need to:

  1. Create security instance
  2. Create WebClientSecurity service
  3. Register service with client
  4. Invoke the client

This is too complicated. It would be nicer to have dedicated services, to be able to do something like this:

WebClient.builder()
  .register(WebClientBasicAuth.create())
 .build();

webClient.get()
 .uri("http...")
 .property(WebClientBasicAuth.USERNAME, "jack")
 .property(WebClientBasicAuth.PASSWORD, "password")
 .request()
 ...

or

webClient.get()
 .uri("http...")
 .register(WebClientBasicAuth.create("jack", "password")
 .request()
 ...

Then we could have a builder to configure details of the service behavior (similar to HttpBasicAuthProvider).

Similar services should be available for other security providers, such as OIDC, HTTP-Singatures.

Metadata

Assignees

Type

No type

Projects

  • Status

    Normal priority

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions