Skip to content

ClientConfig in DsfClientJersey overwrites Authentication Features #432

@wetret

Description

@wetret

It matters whether Features for authentication in the Jersey client builder are registered before or after a ClientConfig is applied. If the features are registered before the ClientConfig, the ClientConfig overwrites the previously registered features.

Instead of:

ClientBuilder builder = ClientBuilder.newBuilder();

authFeatures.forEach(builder::register);

ClientConfig config = new ClientConfig();
builder.withConfig(config);

it should therefore be:

ClientBuilder builder = ClientBuilder.newBuilder();

ClientConfig config = new ClientConfig();
builder.withConfig(config);

authFeatures.forEach(builder::register);

This should be changed in the DsfClientJersey of the API v2 implementation:

ClientBuilder builder = ClientBuilder.newBuilder();
authFeatures.forEach(builder::register);
if (sslContext != null)
builder.sslContext(sslContext);
ClientConfig config = new ClientConfig();
config.connectorProvider(new ApacheConnectorProvider());
config.property(ClientProperties.PROXY_URI, proxySchemeHostPort);
config.property(ClientProperties.PROXY_USERNAME, proxyUserName);
config.property(ClientProperties.PROXY_PASSWORD, proxyPassword == null ? null : String.valueOf(proxyPassword));
builder.withConfig(config);

Metadata

Metadata

Assignees

Labels

Process APIIssue related to the process plugin APIbugSomething isn't working

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions