keycloak-aplcache

Details

diff --git a/services/src/main/java/org/keycloak/services/resources/admin/AdminRoot.java b/services/src/main/java/org/keycloak/services/resources/admin/AdminRoot.java
index 97c1472..d57e96e 100755
--- a/services/src/main/java/org/keycloak/services/resources/admin/AdminRoot.java
+++ b/services/src/main/java/org/keycloak/services/resources/admin/AdminRoot.java
@@ -101,7 +101,7 @@ public class AdminRoot {
     protected RealmModel locateRealm(String name, RealmManager realmManager) {
         RealmModel realm = realmManager.getRealmByName(name);
         if (realm == null) {
-            throw new NotFoundException("Realm " + name + " not found");
+            throw new NotFoundException("Realm not found.  Did you type in a bad URL?");
         }
         return realm;
     }
diff --git a/services/src/main/java/org/keycloak/services/resources/admin/AuthenticationManagementResource.java b/services/src/main/java/org/keycloak/services/resources/admin/AuthenticationManagementResource.java
index 2cb9137..84ccb7d 100755
--- a/services/src/main/java/org/keycloak/services/resources/admin/AuthenticationManagementResource.java
+++ b/services/src/main/java/org/keycloak/services/resources/admin/AuthenticationManagementResource.java
@@ -782,7 +782,7 @@ public class AuthenticationManagementResource {
     public RequiredActionProviderRepresentation getRequiredAction(@PathParam("alias") String alias) {
         RequiredActionProviderModel model = realm.getRequiredActionProviderByAlias(alias);
         if (model == null) {
-            throw new NotFoundException("Failed to find required action: " + alias);
+            throw new NotFoundException("Failed to find required action");
         }
         return toRepresentation(model);
     }
@@ -795,7 +795,7 @@ public class AuthenticationManagementResource {
         this.auth.requireManage();
         RequiredActionProviderModel model = realm.getRequiredActionProviderByAlias(alias);
         if (model == null) {
-            throw new NotFoundException("Failed to find required action: " + alias);
+            throw new NotFoundException("Failed to find required action");
         }
         RequiredActionProviderModel update = new RequiredActionProviderModel();
         update.setId(model.getId());
@@ -814,7 +814,7 @@ public class AuthenticationManagementResource {
         this.auth.requireManage();
         RequiredActionProviderModel model = realm.getRequiredActionProviderByAlias(alias);
         if (model == null) {
-            throw new NotFoundException("Failed to find required action: " + alias);
+            throw new NotFoundException("Failed to find required action.");
         }
         realm.removeRequiredActionProvider(model);
     }
diff --git a/services/src/main/java/org/keycloak/services/resources/admin/ClientResource.java b/services/src/main/java/org/keycloak/services/resources/admin/ClientResource.java
index b85aa39..821f279 100755
--- a/services/src/main/java/org/keycloak/services/resources/admin/ClientResource.java
+++ b/services/src/main/java/org/keycloak/services/resources/admin/ClientResource.java
@@ -436,7 +436,7 @@ public class ClientResource {
 
         Integer time = client.getRegisteredNodes().get(node);
         if (time == null) {
-            throw new NotFoundException("Client does not have a node " + node);
+            throw new NotFoundException("Client does not have node ");
         }
         client.unregisterNode(node);
         adminEvent.operation(OperationType.DELETE).resourcePath(uriInfo).success();
diff --git a/services/src/main/java/org/keycloak/services/resources/admin/ClientsResource.java b/services/src/main/java/org/keycloak/services/resources/admin/ClientsResource.java
index 77abf12..862aa09 100755
--- a/services/src/main/java/org/keycloak/services/resources/admin/ClientsResource.java
+++ b/services/src/main/java/org/keycloak/services/resources/admin/ClientsResource.java
@@ -112,7 +112,7 @@ public class ClientsResource {
     public ClientResource getClient(final @PathParam("id") String id) {
         ClientModel clientModel = realm.getClientById(id);
         if (clientModel == null) {
-            throw new NotFoundException("Could not find client: " + id);
+            throw new NotFoundException("Could not find client");
         }
 
         session.getContext().setClient(clientModel);
diff --git a/services/src/main/java/org/keycloak/services/resources/admin/IdentityProvidersResource.java b/services/src/main/java/org/keycloak/services/resources/admin/IdentityProvidersResource.java
index 9b5bebb..8b2a049 100755
--- a/services/src/main/java/org/keycloak/services/resources/admin/IdentityProvidersResource.java
+++ b/services/src/main/java/org/keycloak/services/resources/admin/IdentityProvidersResource.java
@@ -155,7 +155,7 @@ public class IdentityProvidersResource {
         }
 
         if (identityProviderModel == null) {
-            throw new NotFoundException("Could not find identity provider: " + alias);
+            throw new NotFoundException("Could not find identity provider");
         }
 
         IdentityProviderResource identityProviderResource = new IdentityProviderResource(this.auth, realm, session, identityProviderModel, adminEvent);
diff --git a/services/src/main/java/org/keycloak/services/resources/admin/RealmsAdminResource.java b/services/src/main/java/org/keycloak/services/resources/admin/RealmsAdminResource.java
index 88117ca..f2494c9 100755
--- a/services/src/main/java/org/keycloak/services/resources/admin/RealmsAdminResource.java
+++ b/services/src/main/java/org/keycloak/services/resources/admin/RealmsAdminResource.java
@@ -208,7 +208,7 @@ public class RealmsAdminResource {
                                             @PathParam("realm") final String name) {
         RealmManager realmManager = new RealmManager(session);
         RealmModel realm = realmManager.getRealmByName(name);
-        if (realm == null) throw new NotFoundException("{realm} = " + name);
+        if (realm == null) throw new NotFoundException("Realm not found.");
 
         if (!auth.getRealm().equals(realmManager.getKeycloakAdminstrationRealm())
                 && !auth.getRealm().equals(realm)) {
diff --git a/services/src/main/java/org/keycloak/services/resources/admin/RoleByIdResource.java b/services/src/main/java/org/keycloak/services/resources/admin/RoleByIdResource.java
index 563d2ca..bea5d52 100755
--- a/services/src/main/java/org/keycloak/services/resources/admin/RoleByIdResource.java
+++ b/services/src/main/java/org/keycloak/services/resources/admin/RoleByIdResource.java
@@ -71,7 +71,7 @@ public class RoleByIdResource extends RoleResource {
     protected RoleModel getRoleModel(String id) {
         RoleModel roleModel = realm.getRoleById(id);
         if (roleModel == null) {
-            throw new NotFoundException("Could not find role with id: " + id);
+            throw new NotFoundException("Could not find role with id");
         }
 
         RealmAuth.Resource r = null;
@@ -183,7 +183,7 @@ public class RoleByIdResource extends RoleResource {
         auth.requireView();
         ClientModel clientModel = realm.getClientById(client);
         if (clientModel == null) {
-            throw new NotFoundException("Could not find client: " + client);
+            throw new NotFoundException("Could not find client");
         }
         return getClientRoleComposites(clientModel, role);
     }
@@ -205,7 +205,7 @@ public class RoleByIdResource extends RoleResource {
         auth.requireView();
         ClientModel clientModel = realm.getClientById(client);
         if (clientModel == null) {
-            throw new NotFoundException("Could not find client: " + client);
+            throw new NotFoundException("Could not find client");
 
         }
         return getClientRoleComposites(clientModel, roleModel);
diff --git a/services/src/main/java/org/keycloak/services/resources/admin/RoleContainerResource.java b/services/src/main/java/org/keycloak/services/resources/admin/RoleContainerResource.java
index 3c57672..f267d15 100755
--- a/services/src/main/java/org/keycloak/services/resources/admin/RoleContainerResource.java
+++ b/services/src/main/java/org/keycloak/services/resources/admin/RoleContainerResource.java
@@ -107,7 +107,7 @@ public class RoleContainerResource extends RoleResource {
 
         RoleModel roleModel = roleContainer.getRole(roleName);
         if (roleModel == null) {
-            throw new NotFoundException("Could not find role: " + roleName);
+            throw new NotFoundException("Could not find role");
         }
 
         return getRole(roleModel);
@@ -127,7 +127,7 @@ public class RoleContainerResource extends RoleResource {
         RoleRepresentation rep = getRole(roleName);
         RoleModel role = roleContainer.getRole(roleName);
         if (role == null) {
-            throw new NotFoundException("Could not find role: " + roleName);
+            throw new NotFoundException("Could not find role");
         }
         deleteRole(role);
 
@@ -150,7 +150,7 @@ public class RoleContainerResource extends RoleResource {
 
         RoleModel role = roleContainer.getRole(roleName);
         if (role == null) {
-            throw new NotFoundException("Could not find role: " + roleName);
+            throw new NotFoundException("Could not find role");
         }
         try {
             updateRole(rep, role);
@@ -177,7 +177,7 @@ public class RoleContainerResource extends RoleResource {
 
         RoleModel role = roleContainer.getRole(roleName);
         if (role == null) {
-            throw new NotFoundException("Could not find role: " + roleName);
+            throw new NotFoundException("Could not find role");
         }
         addComposites(adminEvent, uriInfo, roles, role);
     }
@@ -197,7 +197,7 @@ public class RoleContainerResource extends RoleResource {
 
         RoleModel role = roleContainer.getRole(roleName);
         if (role == null) {
-            throw new NotFoundException("Could not find role: " + roleName);
+            throw new NotFoundException("Could not find role");
         }
         return getRoleComposites(role);
     }
@@ -217,7 +217,7 @@ public class RoleContainerResource extends RoleResource {
 
         RoleModel role = roleContainer.getRole(roleName);
         if (role == null) {
-            throw new NotFoundException("Could not find role: " + roleName);
+            throw new NotFoundException("Could not find role");
         }
         return getRealmRoleComposites(role);
     }
@@ -240,11 +240,11 @@ public class RoleContainerResource extends RoleResource {
 
         RoleModel role = roleContainer.getRole(roleName);
         if (role == null) {
-            throw new NotFoundException("Could not find role: " + roleName);
+            throw new NotFoundException("Could not find role");
         }
         ClientModel clientModel = realm.getClientById(client);
         if (client == null) {
-            throw new NotFoundException("Could not find client: " + client);
+            throw new NotFoundException("Could not find client");
 
         }
         return getClientRoleComposites(clientModel, role);
@@ -267,7 +267,7 @@ public class RoleContainerResource extends RoleResource {
 
         RoleModel role = roleContainer.getRole(roleName);
         if (role == null) {
-            throw new NotFoundException("Could not find role: " + roleName);
+            throw new NotFoundException("Could not find role");
         }
         deleteComposites(roles, role);
         adminEvent.operation(OperationType.DELETE).resourcePath(uriInfo).success();
diff --git a/services/src/main/java/org/keycloak/services/resources/admin/RoleResource.java b/services/src/main/java/org/keycloak/services/resources/admin/RoleResource.java
index ded9193..827b817 100755
--- a/services/src/main/java/org/keycloak/services/resources/admin/RoleResource.java
+++ b/services/src/main/java/org/keycloak/services/resources/admin/RoleResource.java
@@ -44,7 +44,7 @@ public abstract class RoleResource {
         for (RoleRepresentation rep : roles) {
             RoleModel composite = realm.getRoleById(rep.getId());
             if (composite == null) {
-                throw new NotFoundException("Could not find composite role: " + rep.getName());
+                throw new NotFoundException("Could not find composite role");
             }
             role.addCompositeRole(composite);
 
@@ -88,7 +88,7 @@ public abstract class RoleResource {
         for (RoleRepresentation rep : roles) {
             RoleModel composite = realm.getRoleById(rep.getId());
             if (composite == null) {
-                throw new NotFoundException("Could not find composite role: " + rep.getName());
+                throw new NotFoundException("Could not find composite role");
             }
             role.removeCompositeRole(composite);
         }
diff --git a/services/src/main/java/org/keycloak/services/resources/admin/UserFederationProvidersResource.java b/services/src/main/java/org/keycloak/services/resources/admin/UserFederationProvidersResource.java
index 9438b59..294e633 100755
--- a/services/src/main/java/org/keycloak/services/resources/admin/UserFederationProvidersResource.java
+++ b/services/src/main/java/org/keycloak/services/resources/admin/UserFederationProvidersResource.java
@@ -183,7 +183,7 @@ public class UserFederationProvidersResource {
 
         UserFederationProviderModel model = KeycloakModelUtils.findUserFederationProviderById(id, realm);
         if (model == null) {
-            throw new NotFoundException("Could not find federation provider with id: " + id);
+            throw new NotFoundException("Could not find federation provider");
         }
 
         UserFederationProviderResource instanceResource = new UserFederationProviderResource(session, realm, this.auth, model, adminEvent);
diff --git a/services/src/main/java/org/keycloak/services/resources/admin/UsersResource.java b/services/src/main/java/org/keycloak/services/resources/admin/UsersResource.java
index 7aeabc2..e3e2437 100755
--- a/services/src/main/java/org/keycloak/services/resources/admin/UsersResource.java
+++ b/services/src/main/java/org/keycloak/services/resources/admin/UsersResource.java
@@ -456,7 +456,7 @@ public class UsersResource {
             // Logout clientSessions for this user and client
             AuthenticationManager.backchannelUserFromClient(session, realm, user, client, uriInfo, headers);
         } else {
-            throw new NotFoundException("Consent not found for user " + id + " and client " + clientId);
+            throw new NotFoundException("Consent not found");
         }
         adminEvent.operation(OperationType.ACTION).resourcePath(uriInfo).success();
     }