Skip to content

Commit 82c2579

Browse files
author
TanyaEf
committed
Updated BasicAuthenticationFilter(delleting header after logout)
1 parent 8627cf7 commit 82c2579

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

src/main/java/com/jaspersoft/jasperserver/jaxrs/client/core/JasperserverRestClient.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@ protected void login(SessionStorage storage) {
6060
AuthenticationCredentials credentials = storage.getCredentials();
6161
WebTarget rootTarget = storage.getRootTarget();
6262
if (configuration.getAuthenticationType() == AuthenticationType.BASIC) {
63-
//TODO registeer ehcoding filter
6463
rootTarget.register(new BasicAuthenticationFilter(credentials));
6564
return;
6665
}

src/main/java/com/jaspersoft/jasperserver/jaxrs/client/filters/BasicAuthenticationFilter.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ public BasicAuthenticationFilter(AuthenticationCredentials credentials) {
2323
@Override
2424
public void filter(ClientRequestContext clientRequestContext) throws IOException {
2525
MultivaluedMap<String, Object> headers = clientRequestContext.getHeaders();
26+
if (credentials.getUsername() == null && credentials.getPassword() == null) {
27+
return;
28+
}
2629
final String basicAuthentication = getBasicAuthentication();
2730
headers.add("Authorization", basicAuthentication);
2831

0 commit comments

Comments
 (0)