wultra / lime-java-core

Core Java classes shared across our projects

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Improve error handling of DefaultRestClient for BasicAuth null password

banterCZ opened this issue · comments

When BasicAuth is enabled and the password is null, an exception from Spring is thrown. Let's improve the error handling.

"java.lang.IllegalArgumentException: Password must not be null,
  
            at org.springframework.util.Assert.notNull(Assert.java:204)
            at org.springframework.http.HttpHeaders.encodeBasicAuth(HttpHeaders.java:1929)
            at org.springframework.web.reactive.function.client.ExchangeFilterFunctions.basicAuthentication(ExchangeFilterFunctions.java:96)
            at com.wultra.core.rest.client.base.DefaultRestClient.initializeWebClient(DefaultRestClient.java:184)
            at com.wultra.core.rest.client.base.DefaultRestClient.<init>(DefaultRestClient.java:110)
            at com.wultra.core.rest.client.base.DefaultRestClient$Builder.build(DefaultRestClient.java:871)
            at io.getlime.security.powerauth.app.server.service.behavior.tasks.CallbackUrlBehavior.initializeRestClient(CallbackUrlBehavior.java:471)