diff --git a/mock/src/main/java/com/tngtech/keycloakmock/impl/handler/TokenRoute.java b/mock/src/main/java/com/tngtech/keycloakmock/impl/handler/TokenRoute.java index 570e811..2f9f631 100644 --- a/mock/src/main/java/com/tngtech/keycloakmock/impl/handler/TokenRoute.java +++ b/mock/src/main/java/com/tngtech/keycloakmock/impl/handler/TokenRoute.java @@ -120,14 +120,15 @@ private void handlePasswordFlow(RoutingContext routingContext) { private void handleClientCredentialsFlow(RoutingContext routingContext) { String clientId = routingContext.request().getFormAttribute("client_id"); String password = routingContext.request().getFormAttribute("client_secret"); - boolean formBasedAuth = clientId != null && !clientId.isEmpty() && password != null && !password.isEmpty(); + boolean formBasedAuth = + clientId != null && !clientId.isEmpty() && password != null && !password.isEmpty(); final User user = routingContext.user(); if (user == null && !formBasedAuth) { routingContext.fail(401); return; } - //if not form based, try using user (BASIC auth or custom) + // if not form based, try using user (BASIC auth or custom) if (!formBasedAuth) { clientId = routingContext.user().get("username"); // Password is a list of roles