KEYCLOAK-8224 Client not found error message

This commit is contained in:
Sebastian Laskawiec 2019-06-25 11:39:41 +02:00 committed by Marek Posolda
parent bed22b9b8d
commit b5d8f70cc7
2 changed files with 10 additions and 4 deletions

View file

@ -686,9 +686,15 @@ public class UserResource {
}
ClientModel client = realm.getClientByClientId(clientId);
if (client == null || !client.isEnabled()) {
if (client == null) {
logger.debugf("Client %s doesn't exist", clientId);
throw new WebApplicationException(
ErrorResponse.error(clientId + " not enabled", Status.BAD_REQUEST));
ErrorResponse.error("Client doesn't exist", Status.BAD_REQUEST));
}
if (!client.isEnabled()) {
logger.debugf("Client %s is not enabled", clientId);
throw new WebApplicationException(
ErrorResponse.error("Client is not enabled", Status.BAD_REQUEST));
}
String redirect;

View file

@ -709,7 +709,7 @@ public class UserTest extends AbstractAdminTest {
assertEquals(400, e.getResponse().getStatus());
ErrorRepresentation error = e.getResponse().readEntity(ErrorRepresentation.class);
Assert.assertEquals("invalidClientId not enabled", error.getErrorMessage());
Assert.assertEquals("Client doesn't exist", error.getErrorMessage());
}
}
@ -1108,7 +1108,7 @@ public class UserTest extends AbstractAdminTest {
assertEquals(400, e.getResponse().getStatus());
ErrorRepresentation error = e.getResponse().readEntity(ErrorRepresentation.class);
Assert.assertEquals("invalidClientId not enabled", error.getErrorMessage());
Assert.assertEquals("Client doesn't exist", error.getErrorMessage());
}
user.sendVerifyEmail();