diff --git a/jwt-client/jwt-client-core/src/main/java/org/entur/jwt/client/AbstractClientCredentialsBuilder.java b/jwt-client/jwt-client-core/src/main/java/org/entur/jwt/client/AbstractClientCredentialsBuilder.java index b1869a9d..ed8fdf98 100644 --- a/jwt-client/jwt-client-core/src/main/java/org/entur/jwt/client/AbstractClientCredentialsBuilder.java +++ b/jwt-client/jwt-client-core/src/main/java/org/entur/jwt/client/AbstractClientCredentialsBuilder.java @@ -107,16 +107,16 @@ public B withScope(String scope) { protected ClientCredentials build(boolean authorizationHeader) { - if (clientId == null) { + if (clientId == null || clientId.isBlank()) { throw new IllegalStateException("Expected client-id"); } - if (host == null) { + if (host == null || host.isBlank()) { throw new IllegalStateException("Expected host"); } - if (issuePath == null) { + if (issuePath == null || issuePath.isBlank()) { throw new IllegalStateException("Expected issue (token) path"); } - if (secret == null) { + if (secret == null || secret.isBlank()) { throw new IllegalStateException("Expected secret"); }