diff --git a/forms/common-themes/src/main/resources/theme/admin/base/resources/js/controllers/applications.js b/forms/common-themes/src/main/resources/theme/admin/base/resources/js/controllers/applications.js index 5f4f6b2164..ff4a8eb45f 100755 --- a/forms/common-themes/src/main/resources/theme/admin/base/resources/js/controllers/applications.js +++ b/forms/common-themes/src/main/resources/theme/admin/base/resources/js/controllers/applications.js @@ -264,7 +264,7 @@ module.controller('ApplicationDetailCtrl', function($scope, realm, application, $scope.save = function() { if ($scope.create) { - if (!$scope.application.redirectUris || $scope.application.redirectUris.length == 0) { + if (!$scope.application.bearerOnly && (!$scope.application.redirectUris || $scope.application.redirectUris.length == 0)) { Notifications.error("You must specify at least one redirect uri"); } else { Application.save({ diff --git a/forms/common-themes/src/main/resources/theme/admin/base/resources/partials/application-detail.html b/forms/common-themes/src/main/resources/theme/admin/base/resources/partials/application-detail.html index 5d4c9301e8..600f72e7a1 100755 --- a/forms/common-themes/src/main/resources/theme/admin/base/resources/partials/application-detail.html +++ b/forms/common-themes/src/main/resources/theme/admin/base/resources/partials/application-detail.html @@ -76,7 +76,7 @@ -
+
-
+
diff --git a/services/src/main/java/org/keycloak/services/resources/admin/ApplicationResource.java b/services/src/main/java/org/keycloak/services/resources/admin/ApplicationResource.java index 7927fad668..0e29604c71 100755 --- a/services/src/main/java/org/keycloak/services/resources/admin/ApplicationResource.java +++ b/services/src/main/java/org/keycloak/services/resources/admin/ApplicationResource.java @@ -75,7 +75,7 @@ public class ApplicationResource { @Path("claims") public ClaimResource getClaimResource() { - return new ClaimResource(application); + return new ClaimResource(application, auth); } @PUT diff --git a/services/src/main/java/org/keycloak/services/resources/admin/ClaimResource.java b/services/src/main/java/org/keycloak/services/resources/admin/ClaimResource.java index 579394eefa..4d260e579e 100755 --- a/services/src/main/java/org/keycloak/services/resources/admin/ClaimResource.java +++ b/services/src/main/java/org/keycloak/services/resources/admin/ClaimResource.java @@ -17,20 +17,24 @@ import javax.ws.rs.core.MediaType; */ public class ClaimResource { protected ClientModel model; + protected RealmAuth auth; - public ClaimResource(ClientModel model) { + public ClaimResource(ClientModel model, RealmAuth auth) { this.model = model; + this.auth = auth; } @GET @Produces(MediaType.APPLICATION_JSON) public ClaimRepresentation getClaims() { + auth.requireView(); return ModelToRepresentation.toRepresentation(model); } @PUT @Consumes(MediaType.APPLICATION_JSON) public void updateClaims(ClaimRepresentation rep) { + auth.requireManage(); ClaimManager.setClaims(model, rep); } } diff --git a/services/src/main/java/org/keycloak/services/resources/admin/OAuthClientResource.java b/services/src/main/java/org/keycloak/services/resources/admin/OAuthClientResource.java index dce37c171b..3c4d9a98c4 100755 --- a/services/src/main/java/org/keycloak/services/resources/admin/OAuthClientResource.java +++ b/services/src/main/java/org/keycloak/services/resources/admin/OAuthClientResource.java @@ -60,7 +60,7 @@ public class OAuthClientResource { @Path("claims") public ClaimResource getClaimResource() { - return new ClaimResource(oauthClient); + return new ClaimResource(oauthClient, auth); }